From 59d5e1b5b8d55fa88b9b8c3912fc9b2a7fc8257a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 13 Dec 2022 22:45:05 +0100 Subject: [PATCH] Changed the color channel mix for grayscale conversions. --- resources/shaders/glsl/core.glsl | 4 ++-- resources/shaders/glsl/scanlines.glsl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/shaders/glsl/core.glsl b/resources/shaders/glsl/core.glsl index 2bcd22374..b918fe969 100644 --- a/resources/shaders/glsl/core.glsl +++ b/resources/shaders/glsl/core.glsl @@ -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); } diff --git a/resources/shaders/glsl/scanlines.glsl b/resources/shaders/glsl/scanlines.glsl index cbc2cb60b..2be2e9b71 100644 --- a/resources/shaders/glsl/scanlines.glsl +++ b/resources/shaders/glsl/scanlines.glsl @@ -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); }