diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-23 23:54:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-23 23:57:10 +0300 |
commit | 3ea2b4ac310af64572045f59debd550e7f9671cc (patch) | |
tree | b750d786d840209c00b0144c788feaf6e7ca7e0c /source/blender/draw/engines/eevee_next | |
parent | 7c6d546f3a72569e15285bc046345b7f60df2aaa (diff) |
EEVEE-Next: Film: Fix incorrect anti-aliasing
There was a confusion about what space the offset was in.
Diffstat (limited to 'source/blender/draw/engines/eevee_next')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_film.cc | 4 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_view.cc | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_film.cc b/source/blender/draw/engines/eevee_next/eevee_film.cc index 42c61ac90a8..a111b1db4a3 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.cc +++ b/source/blender/draw/engines/eevee_next/eevee_film.cc @@ -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 diff --git a/source/blender/draw/engines/eevee_next/eevee_view.cc b/source/blender/draw/engines/eevee_next/eevee_view.cc index 1a222dc4ebd..8052ea76def 100644 --- a/source/blender/draw/engines/eevee_next/eevee_view.cc +++ b/source/blender/draw/engines/eevee_next/eevee_view.cc @@ -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()); |