Browse Source

Fix Dithering Negative Results

“Sebastien 7 years ago
parent
commit
8f391d5d38
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Shaders/ShadersInclude/helperFunctions.fx

+ 2 - 1
src/Shaders/ShadersInclude/helperFunctions.fx

@@ -72,6 +72,7 @@ float getRand(vec2 seed) {
 
 vec3 dither(vec2 seed, vec3 color) {
 	float rand = getRand(seed);
-	color.rgb += mix(-0.5/255.0, 0.5/255.0, rand);
+	color += mix(-0.5/255.0, 0.5/255.0, rand);
+	color = max(color, 0.0);
 	return color;
 }