diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-27 18:35:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-28 18:01:05 +0300 |
commit | 1e0aa2612c3f62607f1d12fd9d594cba96680f6c (patch) | |
tree | 086804c2186d8ba7593ea56d050bc3d1abc1f3e8 /source/blender/draw/engines/eevee_next/eevee_instance.cc | |
parent | 82327ce01de9be65b20c261977c9c3ccb59e0952 (diff) |
EEVEE-Next: Motion Blur new implementation
The new implementation leverage compute shaders to reduce the
number of passes and complexity.
The max blur amount is now detected automatically, replacing the property
in the render panel by a simple checkbox.
The dilation algorithm has also been rewritten from scratch into a 1 pass
algorithm that does the dilation more efficiently and more precisely.
Some differences with the old implementation can be observed in areas with
complex motion.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_instance.cc')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_instance.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index 63d2dab6b4e..2bd47d9cfc6 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -61,6 +61,7 @@ void Instance::init(const int2 &output_res, camera.init(); film.init(output_res, output_rect); velocity.init(); + motion_blur.init(); main_view.init(); } @@ -93,14 +94,14 @@ void Instance::update_eval_members() void Instance::begin_sync() { materials.begin_sync(); - velocity.begin_sync(); + velocity.begin_sync(); /* NOTE: Also syncs camera. */ gpencil_engine_enabled = false; + motion_blur.sync(); pipelines.sync(); main_view.sync(); world.sync(); - camera.sync(); film.sync(); } @@ -212,13 +213,9 @@ void Instance::render_sample() sampling.step(); main_view.render(); -} - -/** \} */ -/* -------------------------------------------------------------------- */ -/** \name Interface - * \{ */ + motion_blur.step(); +} void Instance::render_frame(RenderLayer *render_layer, const char *view_name) { @@ -259,7 +256,10 @@ void Instance::draw_viewport(DefaultFramebufferList *dfbl) render_sample(); velocity.step_swap(); - if (!sampling.finished_viewport()) { + /* Do not request redraw during viewport animation to lock the framerate to the animation + * playback rate. This is in order to preserve motion blur aspect and also to avoid TAA reset + * that can show flickering. */ + if (!sampling.finished_viewport() && !DRW_state_is_playback()) { DRW_viewport_request_redraw(); } |