1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/files/shaders/compatibility/luminance/luminance.frag
2023-02-25 11:03:39 -08:00

15 lines
304 B
GLSL

#version 120
#include "lib/luminance/constants.glsl"
varying vec2 uv;
uniform sampler2D sceneTex;
void main()
{
float lum = dot(texture2D(sceneTex, uv).rgb, vec3(0.2126, 0.7152, 0.0722));
lum = max(lum, epsilon);
gl_FragColor.r = clamp((log2(lum) - minLog) * invLogLumRange, 0.0, 1.0);
}