mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-04-24 00:21:06 +00:00
Removed gl_satformula option from present.fp to save an if, could be replaces with #define
This commit is contained in:
parent
b721367ff8
commit
d333e46a45
1 changed files with 3 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue