1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/files/shaders/hdr_fragment.glsl
2022-05-15 10:03:58 -07:00

15 lines
402 B
GLSL

#version 120
varying vec2 uv;
uniform sampler2D luminanceSceneTex;
uniform sampler2D prevLuminanceSceneTex;
void main()
{
float prevLum = texture2D(prevLuminanceSceneTex, vec2(0.5, 0.5)).r;
float l = texture2D(luminanceSceneTex, vec2(0.5, 0.5)).r;
float weightedAvgLum = exp2((l * @logLumRange) + @minLog);
gl_FragColor.r = prevLum + (weightedAvgLum - prevLum) * @hdrExposureTime;
}