Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-10-16 13:56:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-10-16 13:56:57 +0300
commit14f490b932ad7b2009563c9ee21103b93143d0bb (patch)
tree6eb6f1dd9965c7e7cd6e54a5fcffabc928129d20 /source/blender/draw/engines
parenteb55ca72f4e6073139d019c62da700fff6bc60f8 (diff)
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.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
index 39db39f8756..06a7def532f 100644
--- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
@@ -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;