|
Blender V5.0
|
#include <eevee_velocity.hh>
Classes | |
| struct | VelocityObjectData |
| struct | VelocityGeometryData |
Public Member Functions | |
| VelocityModule (Instance &inst) | |
| ~VelocityModule () | |
| template<typename PassType> | |
| void | bind_resources (PassType &pass) |
Public Attributes | |
| Map< ObjectKey, VelocityObjectData > | velocity_map |
| Map< uint64_t, VelocityGeometryData > | geometry_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 (ObjectKey &object_key, const ObjectRef &object_ref, int recalc, ResourceHandleRange resource_handle, ModifierData *modifier_data=nullptr, ParticleSystem *particle_sys=nullptr) |
| void | step_swap () |
| void | begin_sync () |
| void | end_sync () |
| bool | camera_has_motion () const |
| bool | camera_changed_projection () const |
| float | step_time_delta_get (eVelocityStep start, eVelocityStep end) const |
| void | geometry_steps_fill () |
Container for scene velocity data.
Definition at line 41 of file eevee_velocity.hh.
|
inline |
Definition at line 116 of file eevee_velocity.hh.
References camera_steps, geometry_steps, and object_steps.
|
inline |
Definition at line 129 of file eevee_velocity.hh.
References camera_steps, geometry_steps, and object_steps.
| void blender::eevee::VelocityModule::begin_sync | ( | ) |
Definition at line 338 of file eevee_velocity.cc.
References BLI_assert, object_steps_usage, step_camera_sync(), blender::eevee::STEP_CURRENT, and blender::eevee::STEP_NEXT.
|
inline |
Definition at line 165 of file eevee_velocity.hh.
References camera_steps, geometry_steps, indirection_buf, object_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_PREVIOUS, VELOCITY_CAMERA_CURR_BUF, VELOCITY_CAMERA_NEXT_BUF, VELOCITY_CAMERA_PREV_BUF, VELOCITY_GEO_NEXT_BUF_SLOT, VELOCITY_GEO_PREV_BUF_SLOT, VELOCITY_INDIRECTION_BUF_SLOT, VELOCITY_OBJ_NEXT_BUF_SLOT, and VELOCITY_OBJ_PREV_BUF_SLOT.
| bool blender::eevee::VelocityModule::camera_changed_projection | ( | ) | const |
Definition at line 440 of file eevee_velocity.cc.
References camera_steps, blender::eevee::STEP_CURRENT, and blender::eevee::STEP_PREVIOUS.
| bool blender::eevee::VelocityModule::camera_has_motion | ( | ) | const |
Definition at line 429 of file eevee_velocity.cc.
References camera_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, and blender::eevee::STEP_PREVIOUS.
| void blender::eevee::VelocityModule::end_sync | ( | ) |
This is the end of the current frame sync. Not the step_sync.
Definition at line 348 of file eevee_velocity.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), camera_steps, ceil_to_multiple_u(), geometry_map, GPU_vertbuf_get_vertex_len(), indirection_buf, max_uu(), object_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, and velocity_map.
| void blender::eevee::VelocityModule::geometry_steps_fill | ( | ) |
Definition at line 237 of file eevee_velocity.cc.
References blender::draw::detail::PassBase< DrawCommandBufType >::barrier(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), BLI_assert, blender::draw::detail::PassBase< DrawCommandBufType >::dispatch(), divide_ceil_u(), DRW_STATE_NO_DRAW, DRW_submission_end(), DRW_submission_start(), geometry_map, geometry_steps, GPU_BARRIER_SHADER_STORAGE, GPU_max_work_group_count(), GPU_storagebuf_copy_sub_from_vertbuf(), GPU_vertbuf_get_format(), GPU_vertbuf_get_vertex_len(), blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::eevee::VelocityModule::VelocityGeometryData::len, max_ii(), blender::eevee::VelocityModule::VelocityGeometryData::ofs, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), blender::draw::detail::PassBase< DrawCommandBufType >::state_set(), velocity_map, blender::eevee::VERTEX_COPY, and VERTEX_COPY_GROUP_SIZE.
Referenced by step_swap(), and step_sync().
| void blender::eevee::VelocityModule::init | ( | ) |
Definition at line 41 of file eevee_velocity.cc.
References RenderData::cfra, EEVEE_RENDER_PASS_VECTOR, Scene::r, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, step_sync(), and RenderData::subframe.
| void blender::eevee::VelocityModule::step_camera_sync | ( | ) |
Definition at line 114 of file eevee_velocity.cc.
References camera_steps, initialized, blender::eevee::STEP_CURRENT, blender::eevee::STEP_PREVIOUS, and step_time.
Referenced by begin_sync(), and step_sync().
| bool blender::eevee::VelocityModule::step_object_sync | ( | ObjectKey & | object_key, |
| const ObjectRef & | object_ref, | ||
| int | recalc, | ||
| ResourceHandleRange | resource_handle, | ||
| ModifierData * | modifier_data = nullptr, | ||
| ParticleSystem * | particle_sys = nullptr ) |
Definition at line 127 of file eevee_velocity.cc.
References blender::draw::curves_pos_buffer_get(), data, Object::data, blender::draw::DRW_cache_mesh_surface_get(), blender::draw::DRW_pointcloud_position_and_radius_buffer_get(), geometry_map, blender::draw::hair_pos_buffer_get(), blender::eevee::VelocityModule::VelocityObjectData::id, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, ID::name, OB_CURVES, OB_MESH, OB_POINTCLOUD, blender::eevee::VelocityIndex::obj, blender::draw::ObjectRef::object, object_steps, object_steps_usage, blender::eevee::VelocityObjectIndex::ofs, blender::eevee::VelocityObjectIndex::resource_id, blender::draw::ResourceHandleRange::resource_index(), blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, Object::type, and velocity_map.
Referenced by blender::eevee::step_object_sync_render().
| 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 305 of file eevee_velocity.cc.
References camera_steps, geometry_steps, geometry_steps_fill(), object_steps, object_steps_usage, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, step_time, and velocity_map.
| void blender::eevee::VelocityModule::step_sync | ( | eVelocityStep | step, |
| float | time ) |
Definition at line 98 of file eevee_velocity.cc.
References DRW_render_object_iter(), geometry_steps_fill(), object_steps_usage, blender::math::step(), and step_camera_sync().
Referenced by init().
| float blender::eevee::VelocityModule::step_time_delta_get | ( | eVelocityStep | start, |
| eVelocityStep | end ) const |
Definition at line 450 of file eevee_velocity.cc.
References step_time.
| 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 105 of file eevee_velocity.hh.
Referenced by bind_resources(), camera_changed_projection(), camera_has_motion(), end_sync(), step_camera_sync(), step_swap(), VelocityModule(), and ~VelocityModule().
| 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 90 of file eevee_velocity.hh.
Referenced by end_sync(), geometry_steps_fill(), and step_object_sync().
| std::array<VelocityGeometryBuf *, 3> blender::eevee::VelocityModule::geometry_steps |
Contains all Geometry steps from deforming objects for each time step.
Definition at line 94 of file eevee_velocity.hh.
Referenced by bind_resources(), geometry_steps_fill(), step_swap(), VelocityModule(), and ~VelocityModule().
| VelocityIndexBuf blender::eevee::VelocityModule::indirection_buf |
Buffer of all VelocityIndex used in this frame. Indexed by draw manager resource id.
Definition at line 98 of file eevee_velocity.hh.
Referenced by bind_resources(), and end_sync().
| std::array<VelocityObjectBuf *, 3> blender::eevee::VelocityModule::object_steps |
Contains all objects matrices for each time step.
Definition at line 92 of file eevee_velocity.hh.
Referenced by bind_resources(), end_sync(), step_object_sync(), step_swap(), VelocityModule(), and ~VelocityModule().
Number of occupied slot in each object_steps.
Definition at line 96 of file eevee_velocity.hh.
Referenced by begin_sync(), step_object_sync(), step_swap(), and step_sync().
| float3 blender::eevee::VelocityModule::step_time |
Frame time at which each steps were evaluated.
Definition at line 100 of file eevee_velocity.hh.
Referenced by step_camera_sync(), step_swap(), and step_time_delta_get().
| 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 88 of file eevee_velocity.hh.
Referenced by end_sync(), geometry_steps_fill(), step_object_sync(), and step_swap().