This patch adds wavelength node support to Eevee,
similar to how Eevee Blackbody node works, thus it is a little off from Cycles
Details
- Reviewers
Clément Foucault (fclem) Brecht Van Lommel (brecht) - Group Reviewers
EEVEE & Viewport Nodes - Commits
- rBa43c7538b802: Eevee Wavelength Node Support
Diff Detail
- Repository
- rB Blender
Event Timeline
I like the straightforwardness of the implementation. Not much to change before I accept this into master.
First I was going to suggest to bake everything inside the texture but realize that would slowdown shader updates.
| source/blender/blenlib/intern/math_color.c | ||
|---|---|---|
| 718 | Comment style. | |
| 751 | Comment style. (i know it's copied code but still) | |
| source/blender/gpu/shaders/material/gpu_shader_material_color_util.glsl | ||
| 115–117 ↗ | (On Diff #37308) | Use a mat3 multiplication. This might help the compiler to optimize. |
| source/blender/gpu/shaders/material/gpu_shader_material_wavelength.glsl | ||
| 8 | Comment style. See https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Comments. | |
| 8 | How was the fitting done? Eye balled? Is is fitting the whole range? What is lg? | |
| 9 | if output is never above 1.0 you can use clamp(rgb, 0.0, 1.0) which is better on some architecture. | |
| source/blender/blenlib/intern/math_color.c | ||
|---|---|---|
| 718 | Don't reference the Cycles code, if there is anything to be explained write it here. | |
| source/blender/gpu/shaders/material/gpu_shader_material_color_util.glsl | ||
| 115–118 ↗ | (On Diff #37308) | Don't hardcode XYZ to RGB conversion, use the appropriate matrix depending on the OpenColorIO config like the sky texture node does. |
- Fix comment style
- Copy comment from Cycles code
- Use mat3 multiplication for XYZ to RGB
- Use IMB_colormangement_get_xyz_to_rgb
| source/blender/gpu/shaders/material/gpu_shader_material_wavelength.glsl | ||
|---|---|---|
| 8 | I copied it from Cycles, also the comment exactly as is, not sure what lg is, same comment in original OSL code | |
Alright patch updated, I'm not sure about moving get_XYZ_to_RGB_for_gpu to node_shader_util, was it a good move?