Blender V4.3
blender::eevee::VelocityModule Class Reference

#include <eevee_velocity.hh>

Classes

struct  VelocityGeometryData
 
struct  VelocityObjectData
 

Public Member Functions

 VelocityModule (Instance &inst)
 
 ~VelocityModule ()
 
template<typename PassType >
void bind_resources (PassType &pass)
 

Public Attributes

Map< ObjectKey, VelocityObjectDatavelocity_map
 
Map< uint64_t, VelocityGeometryDatageometry_map
 
std::array< VelocityObjectBuf *, 3 > object_steps
 
std::array< VelocityGeometryBuf *, 3 > geometry_steps
 
int3 object_steps_usage = int3(0)
 
VelocityIndexBuf indirection_buf
 
float3 step_time
 
std::array< CameraDataBuf *, 3 > camera_steps
 

VelocityModule

void init ()
 
void step_camera_sync ()
 
void step_sync (eVelocityStep step, float time)
 
bool step_object_sync (Object *ob, ObjectKey &object_key, ResourceHandle resource_handle, int recalc=0, ModifierData *modifier_data=nullptr, ParticleSystem *particle_sys=nullptr)
 
void step_swap ()
 
void begin_sync ()
 
void end_sync ()
 
void bind_resources (DRWShadingGroup *grp)
 
bool camera_has_motion () const
 
bool camera_changed_projection () const
 
float step_time_delta_get (eVelocityStep start, eVelocityStep end) const
 
void geometry_steps_fill ()
 

Detailed Description

Container for scene velocity data.

Definition at line 29 of file eevee_velocity.hh.

Constructor & Destructor Documentation

◆ VelocityModule()

blender::eevee::VelocityModule::VelocityModule ( Instance & inst)
inline

Definition at line 76 of file eevee_velocity.hh.

References camera_steps, geometry_steps, and object_steps.

◆ ~VelocityModule()

blender::eevee::VelocityModule::~VelocityModule ( )
inline

Definition at line 89 of file eevee_velocity.hh.

References camera_steps, geometry_steps, and object_steps.

Member Function Documentation

◆ begin_sync()

void blender::eevee::VelocityModule::begin_sync ( )

◆ bind_resources() [1/2]

◆ bind_resources() [2/2]

◆ camera_changed_projection()

bool blender::eevee::VelocityModule::camera_changed_projection ( ) const

◆ camera_has_motion()

◆ end_sync()

◆ geometry_steps_fill()

◆ init()

◆ step_camera_sync()

◆ step_object_sync()

◆ step_swap()

void blender::eevee::VelocityModule::step_swap ( )

In Render, moves the next frame data to previous frame data. Nullify next frame data. In Viewport, the current frame data will be used as previous frame data in the next frame.

Definition at line 306 of file eevee_velocity.cc.

References camera_steps, geometry_steps, geometry_steps_fill(), blender::eevee::Instance::is_viewport(), object_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, step_time, and velocity_map.

Referenced by blender::eevee::Instance::draw_viewport(), blender::eevee::Instance::draw_viewport_image_render(), and blender::eevee::MotionBlurModule::step().

◆ step_sync()

◆ step_time_delta_get()

float blender::eevee::VelocityModule::step_time_delta_get ( eVelocityStep start,
eVelocityStep end ) const

Definition at line 461 of file eevee_velocity.cc.

References step_time.

Referenced by blender::eevee::MotionBlurModule::render().

Member Data Documentation

◆ camera_steps

std::array<CameraDataBuf *, 3> blender::eevee::VelocityModule::camera_steps

Copies of camera data. One for previous and one for next time step.

Definition at line 65 of file eevee_velocity.hh.

Referenced by bind_resources(), bind_resources(), camera_changed_projection(), camera_has_motion(), end_sync(), step_camera_sync(), step_swap(), VelocityModule(), and ~VelocityModule().

◆ geometry_map

Map<uint64_t, VelocityGeometryData> blender::eevee::VelocityModule::geometry_map

Geometry to be copied to VelocityGeometryBuf. Indexed by evaluated ID hash. Empty after

Definition at line 50 of file eevee_velocity.hh.

Referenced by end_sync(), geometry_steps_fill(), and step_object_sync().

◆ geometry_steps

std::array<VelocityGeometryBuf *, 3> blender::eevee::VelocityModule::geometry_steps

Contains all Geometry steps from deforming objects for each time step.

Definition at line 54 of file eevee_velocity.hh.

Referenced by bind_resources(), bind_resources(), geometry_steps_fill(), step_swap(), VelocityModule(), and ~VelocityModule().

◆ indirection_buf

VelocityIndexBuf blender::eevee::VelocityModule::indirection_buf

Buffer of all VelocityIndex used in this frame. Indexed by draw manager resource id.

Definition at line 58 of file eevee_velocity.hh.

Referenced by bind_resources(), bind_resources(), and end_sync().

◆ object_steps

std::array<VelocityObjectBuf *, 3> blender::eevee::VelocityModule::object_steps

Contains all objects matrices for each time step.

Definition at line 52 of file eevee_velocity.hh.

Referenced by bind_resources(), bind_resources(), end_sync(), step_object_sync(), step_swap(), VelocityModule(), and ~VelocityModule().

◆ object_steps_usage

int3 blender::eevee::VelocityModule::object_steps_usage = int3(0)

Number of occupied slot in each object_steps.

Definition at line 56 of file eevee_velocity.hh.

Referenced by begin_sync(), step_object_sync(), and step_sync().

◆ step_time

float3 blender::eevee::VelocityModule::step_time

Frame time at which each steps were evaluated.

Definition at line 60 of file eevee_velocity.hh.

Referenced by step_camera_sync(), step_swap(), and step_time_delta_get().

◆ velocity_map

Map<ObjectKey, VelocityObjectData> blender::eevee::VelocityModule::velocity_map

The map contains indirection indices to the obmat and geometry in each step buffer. Note that each object component gets its own resource id so one component correspond to one geometry offset.

Definition at line 48 of file eevee_velocity.hh.

Referenced by end_sync(), geometry_steps_fill(), step_object_sync(), and step_swap().


The documentation for this class was generated from the following files: