소스 검색

Fix Dithering Negative Results

“Sebastien 7 년 전
부모
커밋
8f391d5d38
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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;
 }