EEVEE: SSR: Fix unreported smoothstep instability when border factor is 0

From the GLSL documentation: `Results are undefined if edge0 ≥ edge1.`
This is the case without this patch.
This commit is contained in:
2020-10-16 12:56:33 +02:00
parent eb55ca72f4
commit 14f490b932

View File

@@ -258,7 +258,7 @@ float screen_border_mask(vec2 hit_co)
{
const float margin = 0.003;
float atten = ssrBorderFac + margin; /* Screen percentage */
hit_co = smoothstep(margin, atten, hit_co) * (1 - smoothstep(1.0 - atten, 1.0 - margin, hit_co));
hit_co = smoothstep(0.0, atten, hit_co) * (1.0 - smoothstep(1.0 - atten, 1.0, hit_co));
float screenfade = hit_co.x * hit_co.y;