EEVEE-Next: Film: Fix incorrect anti-aliasing

There was a confusion about what space the offset was in.
This commit is contained in:
Clément Foucault
2022-07-23 22:54:34 +02:00
parent 7c6d546f3a
commit 3ea2b4ac31
2 changed files with 4 additions and 2 deletions

View File

@@ -441,8 +441,8 @@ float2 Film::pixel_jitter_get() const
jitter = Sampling::sample_disk(jitter) * data_.filter_size;
}
else {
/* Jitter the size of a whole pixel. */
jitter = jitter * 2.0f - 1.0f;
/* Jitter the size of a whole pixel. [-0.5..0.5] */
jitter -= 0.5f;
}
/* TODO(fclem): Mixed-resolution rendering: We need to offset to each of the target pixel covered
* by a render pixel, ideally, by choosing one randomly using another sampling dimension, or by

View File

@@ -181,6 +181,8 @@ void ShadingView::update_view()
/* Anti-Aliasing / Super-Sampling jitter. */
float2 jitter = inst_.film.pixel_jitter_get() / float2(extent_);
/* Transform to NDC space. */
jitter *= 2.0f;
window_translate_m4(winmat.ptr(), winmat.ptr(), UNPACK2(jitter));
DRW_view_update_sub(sub_view_, viewmat.ptr(), winmat.ptr());