1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-15 22:49:48 +00:00
OpenMW/files/shaders/compatibility/luminance/resolve.frag

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

19 lines
506 B
GLSL
Raw Normal View History

2022-07-23 03:41:08 +00:00
#version 120
2023-02-25 19:03:39 +00:00
#include "lib/luminance/constants.glsl"
2022-07-23 03:41:08 +00:00
varying vec2 uv;
uniform sampler2D luminanceSceneTex;
uniform sampler2D prevLuminanceSceneTex;
uniform float osg_DeltaFrameTime;
void main()
{
float prevLum = texture2D(prevLuminanceSceneTex, vec2(0.5, 0.5)).r;
float currLum = texture2D(luminanceSceneTex, vec2(0.5, 0.5)).r;
2023-02-25 19:03:39 +00:00
float avgLum = exp2((currLum * logLumRange) + minLog);
gl_FragColor.r = prevLum + (avgLum - prevLum) * (1.0 - exp(-osg_DeltaFrameTime * hdrExposureTime));
2022-07-23 03:41:08 +00:00
}