mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- mystery of desaturation shader solved: The old code passed '1-desaturation' to the shader, the new code 'desaturation', so for the 'mix' function to work its arguments must be swapped.
This commit is contained in:
parent
54425ee2ef
commit
39775cc904
1 changed files with 2 additions and 7 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue