EEVEE-Next: Film: Fix incorrect anti-aliasing
There was a confusion about what space the offset was in.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user