diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index 35b355206b..afd075984f 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -31,13 +31,8 @@ vec4 desaturate(vec4 texel) { if (uDesaturationFactor > 0.0) { - float gray = (texel.r * 0.3 + texel.g * 0.56 + texel.b * 0.14) * uDesaturationFactor; - - vec4 desaturated = vec4(gray,gray,gray,texel.a); - // I have absolutely no idea why this works and 'mix' doesn't... - texel *= (1.0-uDesaturationFactor); - return texel + desaturated; - //return mix (desaturated, texel, uDesaturationFactor); + float gray = (texel.r * 0.3 + texel.g * 0.56 + texel.b * 0.14); + return mix (texel, vec4(gray,gray,gray,texel.a), uDesaturationFactor); } else {