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.
This commit is contained in:
Clément Foucault 2020-10-21 22:51:23 +02:00
parent 0cbe6387e9
commit 27137c479c
Notes: blender-bot 2023-02-14 09:24:53 +01:00
Referenced by issue #81105, Eevee SSR quality regression in 2.91 alpha
1 changed files with 4 additions and 3 deletions

View File

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