* Port over new code tables from Cycles * Convert Rec.709 to scene linear for lookup table. * Move code for wavelength and blackbody to IMB so they can access the required transforms, which are not in blenlib. * Remove clamping from blackbody shader to bypass the texture read. Since it's variable now easiest to just always read from the texture than pass additional parameters. * Fold XYZ to RGB conversion into the wavelength table. Ref T68926
8 lines
325 B
GLSL
8 lines
325 B
GLSL
void node_wavelength(float wavelength, sampler1DArray spectrummap, float layer, out vec4 color)
|
|
{
|
|
float t = (wavelength - 380.0) / (780.0 - 380.0);
|
|
vec3 rgb = texture(spectrummap, vec2(t, layer)).rgb;
|
|
rgb *= 1.0 / 2.52; /* Empirical scale from lg to make all comps <= 1. */
|
|
color = vec4(clamp(rgb, 0.0, 1.0), 1.0);
|
|
}
|