Eevee: Try to fix NaN caused by normal maps + bentnormals
authorClément Foucault <foucault.clem@gmail.com>
Fri, 7 Jun 2019 11:53:30 +0000 (13:53 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 7 Jun 2019 11:53:30 +0000 (13:53 +0200)
Should help with T65118.

source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl

index acfc2af..8662c0e 100644 (file)
@@ -177,7 +177,7 @@ void integrate_slice(
   /* Solving inner integral */
   vec2 h_2 = 2.0 * h;
   vec2 vd = -cos(h_2 - n) + cos_n + h_2 * sin(n);
-  float vis = (vd.x + vd.y) * 0.25 * n_proj_len;
+  float vis = saturate((vd.x + vd.y) * 0.25 * n_proj_len);
 
   visibility += vis;