chromakey.frag: Fix color distance equation

The equation for calculating the distance from the key color to a
pixels color was missing the red channel component.
This commit is contained in:
Thomas Wilshaw
2023-09-19 15:24:52 +01:00
parent b04d16c95b
commit 8ce00fd975
+1 -1
View File
@@ -48,7 +48,7 @@ vec4 CIExyz_to_Lab(vec4 CIE) {
float colorclose(vec4 col, vec4 key, float tola,float tolb) {
// Decides if a color is close to the specified hue
float temp = sqrt(((key.g-col.g)*(key.g-col.g))+((key.b-col.b)*(key.b-col.b)));
float temp = sqrt(((key.g-col.g)*(key.g-col.g))+((key.b-col.b)*(key.b-col.b))+((key.b-col.r)*(key.b-col.r)));
if (temp < tola) {return (0.0);}
if (temp < tolb) {return ((temp-tola)/(tolb-tola));}
return (1.0);