mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed an issue where grayscale conversion was not done correctly for BGRA textures.
This commit is contained in:
parent
86772dbf6d
commit
ef671580c3
|
@ -99,7 +99,12 @@ void main()
|
||||||
|
|
||||||
// Saturation.
|
// Saturation.
|
||||||
if (saturation != 1.0) {
|
if (saturation != 1.0) {
|
||||||
vec3 grayscale = vec3(dot(sampledColor.rgb, vec3(0.34, 0.55, 0.11)));
|
vec3 grayscale;
|
||||||
|
// Premultiplied textures are all in BGRA format.
|
||||||
|
if (0x0u != (shaderFlags & 0x01u))
|
||||||
|
grayscale = vec3(dot(sampledColor.bgr, vec3(0.34, 0.55, 0.11)));
|
||||||
|
else
|
||||||
|
grayscale = vec3(dot(sampledColor.rgb, vec3(0.34, 0.55, 0.11)));
|
||||||
vec3 blendedColor = mix(grayscale, sampledColor.rgb, saturation);
|
vec3 blendedColor = mix(grayscale, sampledColor.rgb, saturation);
|
||||||
sampledColor = vec4(blendedColor, sampledColor.a);
|
sampledColor = vec4(blendedColor, sampledColor.a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue