Browse Source

move grain to before gammaCorrection

Trevor Baron 7 years ago
parent
commit
8715c90768

+ 4 - 0
src/Shaders/ShadersInclude/imageProcessingFunctions.fx

@@ -81,6 +81,10 @@ vec4 applyImageProcessing(vec4 result) {
 	result.rgb = 1.0 - exp2(-tonemappingCalibration * result.rgb);
 #endif
 
+#ifdef GRAIN
+	result.rgb = dither(vUV*(grainAnimatedSeed+1.), result.rgb, grainVarianceAmount);
+#endif
+
 	// Going back to gamma space
 	result.rgb = toGammaSpace(result.rgb);
 	result.rgb = clamp(result.rgb, 0.0, 1.0);

+ 0 - 3
src/Shaders/imageProcessing.fragment.fx

@@ -26,8 +26,5 @@ void main(void)
 	#endif
 #endif
 
-#ifdef GRAIN
-	result.rgb = dither(vUV*(grainAnimatedSeed+1.), result.rgb, grainVarianceAmount);
-#endif
 	gl_FragColor = result;
 }