EEVEE: Screen Space Raytrace: Fix unreported banding artifacts

The artifact manifested as lines of different values caused by faillure to
trace the depth buffer correctly.

Adding a ad-hoc value to the step size to mitigate the issue.
This commit is contained in:
Clément Foucault 2020-10-21 17:57:43 +02:00
parent 23ec1f90e7
commit 0cbe6387e9
Notes: blender-bot 2023-02-14 08:40:26 +01:00
Referenced by issue #81105, Eevee SSR quality regression in 2.91 alpha
1 changed files with 2 additions and 1 deletions

View File

@ -173,7 +173,8 @@ vec3 raycast(int index,
float iter;
for (iter = 1.0; !hit && (ray_time < max_time) && (iter < MAX_STEP); iter++) {
/* Minimum stride of 2 because we are using half res minmax zbuffer. */
float stride = max(1.0, iter * trace_quality) * 2.0;
/* WORKAROUND: Factor is a bit higher than 2 to avoid some banding. To investigate. */
float stride = max(1.0, iter * trace_quality) * (2.0 + 0.05);
float lod = log2(stride * 0.5 * trace_quality) * lod_fac;
ray_time += stride;