Fix T65118 Eevee: NaN when using bent normals

This commit is contained in:
Clément Foucault 2019-06-05 21:31:19 +02:00
parent 94e6526ed0
commit 8fa65ed31b
Notes: blender-bot 2023-02-14 02:26:42 +01:00
Referenced by issue #65707, Adding any shader to world other than "Background" causes HOM (hall of mirrors) effect/depth buffer to not be cleared
Referenced by issue #65705, No cascade shadows in Eevee in orthographic view.
Referenced by issue #65584, OpenGL render bugs with JACK
Referenced by issue #65118, Eevee: ludicrous high value fireflys AO+Bent normals
1 changed files with 4 additions and 4 deletions

View File

@ -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. */