Changed the color channel mix for grayscale conversions.

This commit is contained in:
Leon Styhre 2022-12-13 22:45:05 +01:00
parent 468d7aa09d
commit 59d5e1b5b8
2 changed files with 3 additions and 3 deletions

View file

@ -75,9 +75,9 @@ void main()
vec3 grayscale;
// Premultiplied textures are all in BGRA format.
if (0x0u != (shaderFlags & 0x01u))
grayscale = vec3(dot(sampledColor.bgr, vec3(0.0721, 0.7154, 0.2125)));
grayscale = vec3(dot(sampledColor.bgr, vec3(0.114, 0.587, 0.299)));
else
grayscale = vec3(dot(sampledColor.rgb, vec3(0.2125, 0.7154, 0.0721)));
grayscale = vec3(dot(sampledColor.rgb, vec3(0.299, 0.587, 0.114)));
vec3 blendedColor = mix(grayscale, sampledColor.rgb, saturation);
sampledColor = vec4(blendedColor, sampledColor.a);
}

View file

@ -158,7 +158,7 @@ void main()
// Saturation.
if (saturation != 1.0) {
vec3 grayscale;
grayscale = vec3(dot(colorTemp.bgr, vec3(0.0721, 0.7154, 0.2125)));
grayscale = vec3(dot(colorTemp.bgr, vec3(0.114, 0.587, 0.299)));
vec3 blendedColor = mix(grayscale, colorTemp.rgb, saturation);
colorTemp = vec4(blendedColor, colorTemp.a);
}