Removed gl_satformula option from present.fp to save an if, could be replaces with #define

This commit is contained in:
Emile Belanger 2021-03-09 16:56:16 +00:00
parent b721367ff8
commit d333e46a45

View file

@ -6,13 +6,10 @@ uniform sampler2D DitherTexture;
vec4 ApplyGamma(vec4 c)
{
c.rgb = min(c.rgb, vec3(2.0)); // for HDR mode - prevents stacked translucent sprites (such as plasma) producing way too bright light
vec3 valgray;
if (GrayFormula == 0)
valgray = vec3(c.r + c.g + c.b) * (1.0 - Saturation) / 3.0 + c.rgb * Saturation;
else
valgray = mix(vec3(dot(c.rgb, vec3(0.3,0.56,0.14))), c.rgb, Saturation);
valgray = mix(vec3(dot(c.rgb, vec3(0.3,0.56,0.14))), c.rgb, Saturation);
vec3 val = valgray * Contrast - (Contrast - 1.0) * 0.5;
val += Brightness * 0.5;
val = pow(max(val, vec3(0.0)), vec3(InvGamma));
@ -32,5 +29,4 @@ vec4 ApplyGamma(vec4 c)
void main()
{
gl_FragColor = ApplyGamma(texture2D(InputTexture, UVOffset + TexCoord * UVScale));
// gl_FragColor = vec4(0.5, 0.3, 0.8, 0.9);
}