|
Blender V5.3
|
#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 (const ObjectHandle &ob_handle, HairParticleInfo const *hair_particle=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 351 of file eevee_velocity.cc.
References blender::BLI_assert(), object_steps_usage, step_camera_sync(), blender::eevee::STEP_CURRENT, and blender::eevee::STEP_NEXT.
Referenced by blender::eevee::Instance::begin_sync().
|
inline |
Definition at line 161 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 453 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 442 of file eevee_velocity.cc.
References camera_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, and blender::eevee::STEP_PREVIOUS.
Referenced by blender::eevee::Instance::begin_sync().
| void blender::eevee::VelocityModule::end_sync | ( | ) |
This is the end of the current frame sync. Not the step_sync.
Definition at line 361 of file eevee_velocity.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), camera_steps, blender::ceil_to_multiple_u(), geometry_map, blender::GPU_vertbuf_get_vertex_len(), indirection_buf, blender::max_uu(), object_steps, blender::draw::detail::StorageCommon< T, len, device_only >::push_update(), blender::draw::StorageArrayBuffer< T, len, device_only >::resize(), blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, and velocity_map.
Referenced by blender::eevee::Instance::end_sync().
| void blender::eevee::VelocityModule::geometry_steps_fill | ( | ) |
Definition at line 239 of file eevee_velocity.cc.
References blender::draw::detail::PassBase< DrawCommandBufType >::barrier(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ssbo(), blender::BLI_assert(), blender::draw::detail::PassBase< DrawCommandBufType >::dispatch(), blender::divide_ceil_u(), blender::DRW_STATE_NO_DRAW, blender::DRW_submission_end(), blender::DRW_submission_start(), geometry_map, geometry_steps, blender::GPU_BARRIER_SHADER_STORAGE, blender::GPU_max_storage_buffer_size(), blender::GPU_max_work_group_count(), blender::GPU_storagebuf_copy_sub_from_vertbuf(), blender::GPU_vertbuf_get_format(), blender::GPU_vertbuf_get_vertex_len(), blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::eevee::VelocityModule::VelocityGeometryData::len, blender::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 blender::eevee::Instance::render_sync(), step_swap(), and step_sync().
| void blender::eevee::VelocityModule::init | ( | ) |
Definition at line 42 of file eevee_velocity.cc.
References blender::RenderData::cfra, blender::EEVEE_RENDER_PASS_VECTOR, blender::Scene::r, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, step_sync(), and blender::RenderData::subframe.
Referenced by blender::eevee::Instance::init(), and blender::eevee::Instance::init_light_bake().
| void blender::eevee::VelocityModule::step_camera_sync | ( | ) |
Definition at line 111 of file eevee_velocity.cc.
References camera_steps, 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 | ( | const ObjectHandle & | ob_handle, |
| HairParticleInfo const * | hair_particle = nullptr ) |
Definition at line 124 of file eevee_velocity.cc.
References blender::draw::curves_pos_buffer_get(), blender::data, blender::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, blender::Object::id, blender::ID_RECALC_GEOMETRY, blender::ID_RECALC_TRANSFORM, blender::draw::ResourceHandle::index(), blender::IndexRange::IndexRange(), blender::draw::ObjectRef::instances_count(), blender::draw::ResourceHandleRange::is_valid(), blender::eevee::HairParticleInfo::md, blender::ID::name, blender::OB_CURVES, blender::OB_MESH, blender::OB_POINTCLOUD, blender::eevee::VelocityIndex::obj, blender::draw::ObjectRef::object, object_steps, object_steps_usage, blender::draw::ObjectRef::object_to_world(), blender::draw::ObjectKey::ObjectKey(), blender::eevee::VelocityObjectIndex::ofs, blender::gpu::shader::metadata::printf, blender::eevee::HairParticleInfo::psys, blender::eevee::BaseHandle::recalc, blender::eevee::ObjectHandle::res_handle, blender::eevee::VelocityObjectIndex::resource_index, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, blender::draw::ResourceHandleRange::sub_handle(), blender::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 318 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.
Referenced by blender::eevee::Instance::draw_viewport(), and blender::eevee::Instance::draw_viewport_image_render().
| void blender::eevee::VelocityModule::step_sync | ( | eVelocityStep | step, |
| float | time ) |
Definition at line 96 of file eevee_velocity.cc.
References blender::DRW_render_object_iter(), geometry_steps_fill(), object_steps_usage, step, and step_camera_sync().
Referenced by init().
| float blender::eevee::VelocityModule::step_time_delta_get | ( | eVelocityStep | start, |
| eVelocityStep | end ) const |
Definition at line 463 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().