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>2021-04-12 17:34:11 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-04-12 22:34:08 +0300
commita4ae2b91c9dd41d06728bf66ea4a3ec320f5c904 (patch)
tree891af3e0e416f96456bd0646e7172699359017b2 /source/blender/draw/engines/eevee/eevee_instance.hh
parent0cd48960379e0acfecd00e95ce111f777a53d076 (diff)
EEVEE: Motion Blur: Add back post process motion blur
This is almost the same thing as old implementation. Differences: - We clamp the motion vectors to their maximum when sampling the velocity buffer. - Velocity rendering (and data manager) is separated from motion blur. This allows outputing the motion vector render pass and in the future use motion vectors to reproject older frames. - Vector render pass support (only if motion blur is disabled, just like cycles). - Velocity tiles are computed in one pass (simpler code, less CPU overhead, less VRAM usage, maybe a bit slower but imperceivable (< 0.3ms)). - Two velocity passes are outputed, one for motion blur fx (applied per shading view) and one for the vector pass. This could be optimized further in the future. - No current support for deformation & hair (to come).
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_instance.hh')
-rw-r--r--source/blender/draw/engines/eevee/eevee_instance.hh17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_instance.hh b/source/blender/draw/engines/eevee/eevee_instance.hh
index d4a6a0439dd..0d0492b81fd 100644
--- a/source/blender/draw/engines/eevee/eevee_instance.hh
+++ b/source/blender/draw/engines/eevee/eevee_instance.hh
@@ -49,8 +49,10 @@ class Instance {
MainView main_view_;
/** Point of view in the scene. Can be init from viewport or camera object. */
Camera camera_;
+ /** Velocity module containing motion data. */
+ Velocity velocity_;
/** Motion blur data. */
- MotionBlur motion_blur_;
+ MotionBlurModule motion_blur_;
/** Lookdev own lightweight instance. May not be allocated. */
// Lookdev *lookdev_ = nullptr;
@@ -69,10 +71,11 @@ class Instance {
Instance(ShaderModule &shared_shaders)
: render_passes_(shared_shaders, camera_, sampling_),
shaders_(shared_shaders),
- shading_passes_(shared_shaders),
- main_view_(shared_shaders, shading_passes_, camera_, sampling_),
+ shading_passes_(shared_shaders, camera_, velocity_),
+ main_view_(shared_shaders, shading_passes_, camera_, sampling_, motion_blur_),
camera_(sampling_),
- motion_blur_(sampling_){};
+ velocity_(),
+ motion_blur_(camera_, sampling_, velocity_){};
~Instance(){};
/**
@@ -116,10 +119,11 @@ class Instance {
}
sampling_.init(scene_);
- motion_blur_.init(scene_, render, depsgraph_);
camera_.init(render_, depsgraph_, camera_object, drw_view_);
+ motion_blur_.init(scene_, render, depsgraph_);
render_passes_.init(scene_, render_layer, v3d_, output_res, output_rect);
main_view_.init(scene_, output_res);
+ velocity_.init(camera_, render_, depsgraph_, render_passes_);
}
/**
@@ -141,6 +145,7 @@ class Instance {
switch (ob->type) {
case OB_MESH:
shading_passes_.opaque.surface_add(ob, nullptr, 0);
+ shading_passes_.velocity.mesh_add(ob);
break;
default:
@@ -157,7 +162,7 @@ class Instance {
void end_sync(void)
{
- motion_blur_.end_sync();
+ velocity_.end_sync();
}
void render_sync(void)