Blender  V3.3
Classes | Public Member Functions | Public Attributes | List of all members
blender::eevee::VelocityModule Class Reference

#include <eevee_velocity.hh>

Classes

struct  VelocityGeometryData
 
struct  VelocityObjectData
 

Public Member Functions

 VelocityModule (Instance &inst)
 
 ~VelocityModule ()
 

Public Attributes

Map< ObjectKey, VelocityObjectDatavelocity_map
 
Map< ID *, VelocityGeometryDatageometry_map
 
std::array< VelocityObjectBuf *, 3 > object_steps
 
std::array< VelocityGeometryBuf *, 3 > geometry_steps
 
int3 object_steps_usage = int3(0)
 
VelocityIndexBuf indirection_buf
 
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, int recalc=0)
 
void step_swap ()
 
void begin_sync ()
 
void end_sync ()
 
void bind_resources (DRWShadingGroup *grp)
 
bool camera_has_motion () const
 

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 71 of file eevee_velocity.hh.

References camera_steps, geometry_steps, and object_steps.

◆ ~VelocityModule()

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

Definition at line 85 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()

void blender::eevee::VelocityModule::bind_resources ( DRWShadingGroup grp)

◆ camera_has_motion()

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

◆ end_sync()

void blender::eevee::VelocityModule::end_sync ( )

◆ init()

void blender::eevee::VelocityModule::init ( )

◆ step_camera_sync()

void blender::eevee::VelocityModule::step_camera_sync ( )

◆ step_object_sync()

bool blender::eevee::VelocityModule::step_object_sync ( Object ob,
ObjectKey object_key,
int  recalc = 0 
)

◆ step_swap()

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

Moves next frame data to previous frame data. Nullify next frame data. IMPORTANT: This runs AFTER drawing in the viewport (so after begin_sync()) but BEFORE drawing in render mode (so before begin_sync()). In viewport the data will be used the next frame.

Definition at line 174 of file eevee_velocity.cc.

References camera_steps, geometry_map, geometry_steps, GPU_storagebuf_copy_sub_from_vertbuf(), GPU_vertbuf_get_vertex_len(), blender::eevee::Instance::is_viewport(), blender::eevee::VelocityModule::VelocityGeometryData::len, max_ii(), object_steps, blender::eevee::VelocityModule::VelocityGeometryData::ofs, SWAP, and velocity_map.

Referenced by blender::eevee::Instance::draw_viewport().

◆ step_sync()

void blender::eevee::VelocityModule::step_sync ( eVelocityStep  step,
float  time 
)

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 63 of file eevee_velocity.hh.

Referenced by bind_resources(), camera_has_motion(), end_sync(), step_camera_sync(), step_swap(), blender::eevee::Film::sync(), VelocityModule(), and ~VelocityModule().

◆ geometry_map

Map<ID *, VelocityGeometryData> blender::eevee::VelocityModule::geometry_map

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

Definition at line 50 of file eevee_velocity.hh.

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

◆ 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(), 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(), 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(), 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().

◆ 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(), step_object_sync(), and step_swap().


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