1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 11:53:53 +00:00
openmw/files/shaders/hdr_luminance_fragment.glsl

13 lines
266 B
Text
Raw Normal View History

2022-05-14 01:58:00 +00:00
#version 120
varying vec2 uv;
uniform sampler2D sceneTex;
void main()
{
float lum = dot(texture2D(sceneTex, uv).rgb, vec3(0.2126, 0.7152, 0.0722));
2022-07-23 03:41:08 +00:00
lum = max(lum, @epsilon);
2022-05-14 01:58:00 +00:00
gl_FragColor.r = clamp((log2(lum) - @minLog) * @invLogLumRange, 0.0, 1.0);
}