gzdoom/wadsrc/static/shaders/glsl/exposurecombine.fp
Christoph Oelckers ad7aaa8f2a - specify fragment output locations in the shader source.
OpenGL has been supporting this since version 3.3 and Vulkan requires it so it's the way to go.
2018-06-12 23:52:33 +02:00

12 lines
318 B
GLSL

in vec2 TexCoord;
layout(location=0) out vec4 FragColor;
uniform sampler2D ExposureTexture;
void main()
{
float light = texture(ExposureTexture, TexCoord).x;
float exposureAdjustment = 1.0 / max(ExposureBase + light * ExposureScale, ExposureMin);
FragColor = vec4(exposureAdjustment, 0.0, 0.0, ExposureSpeed);
}