summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/shaders
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-01-16 18:08:07 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-01-16 18:08:07 +0100
commitd6c7d4ab5dd27311adbc340a857b1a6930324749 (patch)
treec41b5844c8d331e73c117fbfd51b65f4990f1324 /servers/rendering/renderer_rd/shaders
parent8958e1b35297baa8ef4f9e03bb4ad105500e3a0c (diff)
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.
Diffstat (limited to 'servers/rendering/renderer_rd/shaders')
-rw-r--r--servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl3
1 files changed, 1 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl b/servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl
index fde5688301..57349e55b1 100644
--- a/servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl
+++ b/servers/rendering/renderer_rd/shaders/screen_space_reflection.glsl
@@ -190,8 +190,7 @@ void main() {
}
vec2 final_pos;
- float grad;
- grad = steps_taken / float(params.num_steps);
+ float grad = (steps_taken + 1.0) / float(params.num_steps);
float initial_fade = params.curve_fade_in == 0.0 ? 1.0 : pow(clamp(grad, 0.0, 1.0), params.curve_fade_in);
float fade = pow(clamp(1.0 - grad, 0.0, 1.0), params.distance_fade) * initial_fade;
final_pos = pos;