1
0
Fork 0
fgdata/Shaders/HDR/luminance.frag
2021-07-23 07:46:05 +02:00

13 lines
233 B
GLSL

#version 330 core
out float luminance;
in vec2 texCoord;
uniform sampler2D hdr_tex;
void main()
{
vec3 hdrColor = texture(hdr_tex, texCoord).rgb;
luminance = log2(max(dot(hdrColor, vec3(0.299, 0.587, 0.114)), 0.0001));
}