1
0
Fork 0
fgdata/Shaders/HDR/luminance.frag

14 lines
232 B
GLSL
Raw Normal View History

2021-04-10 09:14:16 +00:00
#version 330 core
out float luminance;
in vec2 texCoord;
uniform sampler2D hdr_tex;
void main()
{
vec3 hdrColor = texture(hdr_tex, texCoord).rgb;
luminance = log(max(dot(hdrColor, vec3(0.299, 0.587, 0.114)), 0.0001));
2021-04-10 09:14:16 +00:00
}