From b4915d624d8daaeaf8bf03c008a5b3f0c9fb6e37 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 2 Jul 2017 16:59:15 -0400 Subject: [PATCH] - removed 'cooling' component of the shader since it technically wasn't really functional (guess we have to use a separate shader to do that) - changed the math to use the 'mix' formula --- wadsrc/static/shaders/glsl/present.fp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index eff874ed2..4690895c2 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -12,13 +12,10 @@ uniform int GrayFormula; vec4 ApplyGamma(vec4 c) { vec3 valgray; - if (Saturation != 1.0) // attempt to cool things a bit, this calculation makes the GPU run really hot - if (GrayFormula == 0) - valgray = vec3(c.r + c.g + c.b) * (1 - Saturation) / 3 + c.rgb * Saturation; - else - valgray = vec3(0.3 * c.r + 0.56 * c.g + 0.14 * c.b) * (1 - Saturation) + c.rgb * Saturation; + if (GrayFormula == 0) + valgray = vec3(c.r + c.g + c.b) * (1 - Saturation) / 3 + c.rgb * Saturation; else - valgray = c.rgb; + 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));