gzdoom/wadsrc/static/shaders/glsl/present.fp
Magnus Norddahl 5849c83028 Added bloom and tonemap to menus
Added gl_renderbuffers CVAR that disables render buffers
Added patch shader support to FShaderProgram
Added OpenGL 2 fallback support to render buffers
2016-07-29 21:31:20 +02:00

21 lines
388 B
GLSL

in vec2 TexCoord;
out vec4 FragColor;
uniform sampler2D InputTexture;
uniform float Gamma;
uniform float Contrast;
uniform float Brightness;
vec4 ApplyGamma(vec4 c)
{
vec3 val = c.rgb * Contrast - (Contrast - 1.0) * 0.5;
val = pow(val, vec3(1.0 / Gamma));
val += Brightness * 0.5;
return vec4(val, c.a);
}
void main()
{
FragColor = ApplyGamma(texture(InputTexture, TexCoord));
}