1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/files/shaders/compatibility/luminance/luminance.frag

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
304 B
GLSL
Raw Normal View History

2022-05-14 01:58:00 +00:00
#version 120
2023-02-25 19:03:39 +00:00
#include "lib/luminance/constants.glsl"
2022-05-14 01:58:00 +00:00
varying vec2 uv;
uniform sampler2D sceneTex;
void main()
{
float lum = dot(texture2D(sceneTex, uv).rgb, vec3(0.2126, 0.7152, 0.0722));
2023-02-25 19:03:39 +00:00
lum = max(lum, epsilon);
2022-05-14 01:58:00 +00:00
2023-02-25 19:03:39 +00:00
gl_FragColor.r = clamp((log2(lum) - minLog) * invLogLumRange, 0.0, 1.0);
2022-05-14 01:58:00 +00:00
}