diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-10-21 23:51:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-10-21 23:56:06 +0300 |
commit | 27137c479cc309bbb72ed4e41d481cdcfb773716 (patch) | |
tree | c6a3f52e20b335ddb1191ac5f188a459accc13a8 /source/blender/draw/engines | |
parent | 0cbe6387e90cb8ed85c8bd48e8c0ad413eca7f9d (diff) |
EEVEE: Screen Space Reflection: Improve contact reflections
This patch helps the case of intricate reflections where the
ray does not travel far before intersecting the geometry.
In these cases there could be false negative exclusion of the ray
caused by the backface rejection threshold.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl index 225bf9b07db..dbb5e660dab 100644 --- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl @@ -235,9 +235,10 @@ vec3 raycast(int index, #endif } - if (discard_backface) { - /* Discard backface hits */ - hit = hit && (prev_delta > 0.0); + /* Discard backface hits. Only do this if the ray traveled enough to avoid loosing intricate + * contact reflections. This is only used for SSReflections. */ + if (discard_backface && prev_delta < 0.0 && curr_time > 4.1) { + hit = false; } /* Reject hit if background. */ |