From a80187f5bcce12d71524712ae7378a501048782a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 16 Jan 2022 18:00:13 +0100 Subject: [PATCH] Fix visible background line in intersections in screen-space reflections Adjusting the step grading by one resolves the issue without affecting performance or introducing adverse artifacts. --- drivers/gles3/shaders/screen_space_reflection.glsl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl index a5285dee329..7ac81a5aeb9 100644 --- a/drivers/gles3/shaders/screen_space_reflection.glsl +++ b/drivers/gles3/shaders/screen_space_reflection.glsl @@ -186,8 +186,7 @@ void main() { } vec2 final_pos; - float grad; - grad = steps_taken / float(num_steps); + float grad = (steps_taken + 1.0) / float(num_steps); float initial_fade = curve_fade_in == 0.0 ? 1.0 : pow(clamp(grad, 0.0, 1.0), curve_fade_in); float fade = pow(clamp(1.0 - grad, 0.0, 1.0), distance_fade) * initial_fade; final_pos = pos;