Browse Source

Improve temporal AA a bit and fix a bug

Panagiotis Christopoulos Charitos 8 years ago
parent
commit
fe70d957e4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      shaders/Taa.frag.glsl

+ 2 - 2
shaders/Taa.frag.glsl

@@ -8,7 +8,7 @@
 #include "shaders/Tonemapping.glsl"
 #include "shaders/Tonemapping.glsl"
 
 
 #define YCBCR 1
 #define YCBCR 1
-const float BLEND_FACTOR = 1.0 / 8.0;
+const float BLEND_FACTOR = 1.0 / 16.0; // Keep it low to have a better result
 
 
 layout(location = 0) in vec2 in_uv;
 layout(location = 0) in vec2 in_uv;
 
 
@@ -65,7 +65,7 @@ void main()
 	float maxLum = computeLuminance(boxMax);
 	float maxLum = computeLuminance(boxMax);
 #endif
 #endif
 
 
-	float diff = abs(lum0 - lum1) / max(lum0, max(lum1, maxLum));
+	float diff = abs(lum0 - lum1) / max(lum0, max(lum1, maxLum + EPSILON));
 	diff = 1.0 - diff;
 	diff = 1.0 - diff;
 	diff = diff * diff;
 	diff = diff * diff;
 	float feedback = mix(0.0, BLEND_FACTOR, diff);
 	float feedback = mix(0.0, BLEND_FACTOR, diff);