Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-07-27 18:35:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-07-28 18:01:05 +0300
commit1e0aa2612c3f62607f1d12fd9d594cba96680f6c (patch)
tree086804c2186d8ba7593ea56d050bc3d1abc1f3e8 /source/blender/draw/engines/eevee_next/eevee_film.cc
parent82327ce01de9be65b20c261977c9c3ccb59e0952 (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_film.cc')
-rw-r--r--source/blender/draw/engines/eevee_next/eevee_film.cc13
1 files changed, 11 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 608bf31335c..60e5f95d803 100644
--- a/source/blender/draw/engines/eevee_next/eevee_film.cc
+++ b/source/blender/draw/engines/eevee_next/eevee_film.cc
@@ -214,6 +214,11 @@ void Film::init(const int2 &extent, const rcti *output_rect)
/* Filter obsolete passes. */
render_passes &= ~(EEVEE_RENDER_PASS_UNUSED_8 | EEVEE_RENDER_PASS_BLOOM);
+ if (scene_eevee.flag & SCE_EEVEE_MOTION_BLUR_ENABLED) {
+ /* Disable motion vector pass if motion blur is enabled. */
+ render_passes &= ~EEVEE_RENDER_PASS_VECTOR;
+ }
+
/* TODO(@fclem): Can't we rely on depsgraph update notification? */
if (assign_if_different(enabled_passes_, render_passes)) {
sampling.reset();
@@ -381,7 +386,7 @@ void Film::sync()
DRW_shgroup_uniform_block_ref(grp, "camera_curr", &(*velocity.camera_steps[STEP_CURRENT]));
DRW_shgroup_uniform_block_ref(grp, "camera_next", &(*velocity.camera_steps[step_next]));
DRW_shgroup_uniform_texture_ref(grp, "depth_tx", &rbuffers.depth_tx);
- DRW_shgroup_uniform_texture_ref(grp, "combined_tx", &rbuffers.combined_tx);
+ DRW_shgroup_uniform_texture_ref(grp, "combined_tx", &combined_final_tx_);
DRW_shgroup_uniform_texture_ref(grp, "normal_tx", &rbuffers.normal_tx);
DRW_shgroup_uniform_texture_ref(grp, "vector_tx", &rbuffers.vector_tx);
DRW_shgroup_uniform_texture_ref(grp, "diffuse_light_tx", &rbuffers.diffuse_light_tx);
@@ -540,7 +545,7 @@ void Film::update_sample_table()
}
}
-void Film::accumulate(const DRWView *view)
+void Film::accumulate(const DRWView *view, GPUTexture *combined_final_tx)
{
if (inst_.is_viewport()) {
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
@@ -556,6 +561,8 @@ void Film::accumulate(const DRWView *view)
update_sample_table();
+ combined_final_tx_ = combined_final_tx;
+
/* Need to update the static references as there could have change from a previous swap. */
weight_src_tx_ = weight_tx_.current();
weight_dst_tx_ = weight_tx_.next();
@@ -588,6 +595,8 @@ void Film::display()
GPU_framebuffer_bind(dfbl->default_fb);
GPU_framebuffer_viewport_set(dfbl->default_fb, UNPACK2(data_.offset), UNPACK2(data_.extent));
+ combined_final_tx_ = inst_.render_buffers.combined_tx;
+
/* Need to update the static references as there could have change from a previous swap. */
weight_src_tx_ = weight_tx_.current();
weight_dst_tx_ = weight_tx_.next();