Fix T77658 EEVEE: Reflection Plane partially missing reflections

The degenerate line workaround was ill defined.
This commit is contained in:
Clément Foucault 2020-10-22 00:20:06 +02:00
parent e1eaf9e2b4
commit 091b433677
Notes: blender-bot 2023-02-14 02:43:21 +01:00
Referenced by issue #77658, Reflection Plane partially missing reflections in EEVEE
1 changed files with 3 additions and 1 deletions

View File

@ -105,7 +105,9 @@ void prepare_raycast(vec3 ray_origin,
/* If the line is degenerate, make it cover at least one pixel
* to not have to handle zero-pixel extent as a special case later */
ss_step.xy += vec2((dot(ss_step.xy, ss_step.xy) < 0.00001) ? 0.001 : 0.0);
if (dot(ss_step.xy, ss_step.xy) < 0.00001) {
ss_step.xy = vec2(0.0, 0.0001);
}
/* Make ss_step cover one pixel. */
ss_step /= max(abs(ss_step.x), abs(ss_step.y));