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

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