Blender V4.3
eevee_motion_blur.hh File Reference
#include "BLI_map.hh"
#include "DEG_depsgraph_query.hh"
#include "eevee_sampling.hh"
#include "eevee_shader_shared.hh"
#include "eevee_velocity.hh"

Go to the source code of this file.

Classes

class  blender::eevee::MotionBlurModule
 

Namespaces

namespace  blender
 
namespace  blender::eevee
 

Detailed Description

Motion blur is done by accumulating scene samples over shutter time. Since the number of step is discrete, quite low, and not per pixel randomized, we couple this with a post processing motion blur.

The post-fx motion blur is done in two directions, from the previous step and to the next.

For a scene with 3 motion steps, a flat shutter curve and shutter time of 2 frame centered on frame we have:

|-----------------—|-----------------—| -1 0 1 Frames

|----------—|----------—|----------—| 1 2 3 Motion steps

|---—|---—|---—|---—|---—|---—| 0 1 2 4 5 6 7 Time Steps

|----------—| One motion step blurs this range. -1 | +1 Objects and geometry steps are recorded here. 0 Scene is rendered here.

Since motion step N and N+1 share one time step we reuse it to avoid an extra scene evaluation.

Note that we have to evaluate -1 and +1 time steps before rendering so eval order is -1, +1, 0. This is because all GPUBatches from the DRWCache are being free when changing a frame.

For viewport, we only have the current and previous step data to work with. So we center the blur on the current frame and extrapolate the motion.

The Post-FX motion blur is based on: "A Fast and Stable Feature-Aware Motion Blur Filter" by Jean-Philippe Guertin, Morgan McGuire, Derek Nowrouzezahrai

Definition in file eevee_motion_blur.hh.