This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_blackbody.glsl
Brecht Van Lommel bdab538b30 Fix Eevee blackbody wrong with non-default scene linear color space
* 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
2022-05-23 22:09:44 +02:00

6 lines
218 B
GLSL

void node_blackbody(float temperature, sampler1DArray spectrummap, float layer, out vec4 color)
{
float t = (temperature - 800.0) / (12000.0 - 800.0);
color = vec4(texture(spectrummap, vec2(t, layer)).rgb, 1.0);
}