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.
This commit is contained in:
Hugo Locurcio 2022-01-16 18:08:07 +01:00
parent 8958e1b352
commit d6c7d4ab5d
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C

View File

@ -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;