Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-06-05 22:31:19 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-06-05 22:33:08 +0300
commit8fa65ed31b7f3aa52669be267f431f0888baa06b (patch)
tree0d2222f5c34a2f8cf22bc7849148975c53ecb547
parent94e6526ed0385a03c62922ec000b802b9e4621dd (diff)
Fix T65118 Eevee: NaN when using bent normals
-rw-r--r--source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
index 944caca6dab..acfc2af93ee 100644
--- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
@@ -198,8 +198,8 @@ void gtao_deferred(
dirs.xy = get_ao_dir(noise.x * 0.5);
dirs.zw = get_ao_dir(noise.x * 0.5 + 0.5);
- bent_normal = vec3(0.0);
- visibility = 0.0;
+ bent_normal = normal * 1e-8;
+ visibility = 1e-8;
horizons = unpack_horizons(horizons);
@@ -217,8 +217,8 @@ void gtao(vec3 normal, vec3 position, vec4 noise, out float visibility, out vec3
vec2 max_dir = get_max_dir(position.z);
vec2 dir = get_ao_dir(noise.x);
- bent_normal = vec3(0.0);
- visibility = 0.0;
+ bent_normal = normal * 1e-8;
+ visibility = 1e-8;
/* Only trace in 2 directions. May lead to a darker result but since it's mostly for
* alpha blended objects that will have overdraw, we limit the performance impact. */