|
Blender V4.3
|
#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, 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 (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 () |
Container for scene velocity data.
Definition at line 29 of file eevee_velocity.hh.
|
inline |
Definition at line 76 of file eevee_velocity.hh.
References camera_steps, geometry_steps, and object_steps.
|
inline |
Definition at line 89 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 object_steps_usage, step_camera_sync(), and blender::eevee::STEP_CURRENT.
Referenced by blender::eevee::Instance::begin_sync().
| void blender::eevee::VelocityModule::bind_resources | ( | DRWShadingGroup * | grp | ) |
Definition at line 425 of file eevee_velocity.cc.
References camera_steps, DRW_shgroup_storage_block_ref, DRW_shgroup_uniform_block_ref, geometry_steps, indirection_buf, blender::eevee::Instance::is_viewport(), next, object_steps, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, and blender::eevee::STEP_PREVIOUS.
|
inline |
Definition at line 127 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 451 of file eevee_velocity.cc.
References camera_steps, blender::eevee::Instance::is_viewport(), blender::eevee::STEP_CURRENT, and blender::eevee::STEP_PREVIOUS.
Referenced by blender::eevee::MotionBlurModule::sync().
| bool blender::eevee::VelocityModule::camera_has_motion | ( | ) | const |
Definition at line 440 of file eevee_velocity.cc.
References camera_steps, blender::eevee::Instance::is_viewport(), blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, and blender::eevee::STEP_PREVIOUS.
Referenced by blender::eevee::DeferredLayer::begin_sync(), blender::eevee::Instance::begin_sync(), and blender::eevee::ShadingView::render().
| void blender::eevee::VelocityModule::end_sync | ( | ) |
This is the end of the current frame sync. Not the step_sync.
Definition at line 345 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, blender::eevee::Instance::is_viewport(), 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 244 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, 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, blender::eevee::Instance::manager, max_ii(), blender::eevee::VelocityModule::VelocityGeometryData::ofs, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), blender::eevee::Instance::shaders, blender::draw::detail::PassBase< DrawCommandBufType >::state_set(), blender::eevee::ShaderModule::static_shader_get(), blender::draw::Manager::submit(), 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 39 of file eevee_velocity.cc.
References RenderData::cfra, EEVEE_RENDER_PASS_VECTOR, blender::eevee::Film::enabled_passes_get(), blender::eevee::Instance::film, blender::eevee::Instance::is_baking(), blender::eevee::Instance::is_viewport(), blender::eevee::Instance::motion_blur, blender::eevee::MotionBlurModule::postfx_enabled(), Scene::r, blender::eevee::Instance::scene, blender::eevee::STEP_CURRENT, blender::eevee::STEP_NEXT, blender::eevee::STEP_PREVIOUS, and step_sync().
Referenced by blender::eevee::Instance::init(), and blender::eevee::Instance::init_light_bake().
| void blender::eevee::VelocityModule::step_camera_sync | ( | ) |
Definition at line 118 of file eevee_velocity.cc.
References blender::eevee::Instance::camera, camera_steps, RenderData::cfra, blender::eevee::Camera::data_get(), blender::eevee::CameraData::initialized, initialized, Scene::r, blender::eevee::Instance::scene, blender::eevee::STEP_CURRENT, blender::eevee::STEP_PREVIOUS, step_time, RenderData::subframe, and blender::eevee::Camera::sync().
Referenced by begin_sync(), and step_sync().
| bool blender::eevee::VelocityModule::step_object_sync | ( | Object * | ob, |
| ObjectKey & | object_key, | ||
| ResourceHandle | resource_handle, | ||
| int | recalc = 0, | ||
| ModifierData * | modifier_data = nullptr, | ||
| ParticleSystem * | particle_sys = nullptr ) |
Definition at line 131 of file eevee_velocity.cc.
References blender::draw::curves_pos_buffer_get(), data, Object::data, DRW_cache_object_pos_vertbuf_get(), blender::draw::DRW_curves_pos_buffer_get(), DRW_hair_pos_buffer_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, blender::eevee::Instance::is_viewport(), ID::name, OB_CURVES, OB_POINTCLOUD, blender::eevee::VelocityIndex::obj, object_steps, object_steps_usage, blender::eevee::VelocityObjectIndex::ofs, blender::eevee::VelocityModule::VelocityGeometryData::pos_buf, blender::eevee::VelocityObjectIndex::resource_id, blender::draw::ResourceHandle::resource_index(), blender::eevee::Instance::scene, 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(), blender::eevee::SyncModule::sync_curves(), blender::eevee::SyncModule::sync_mesh(), and blender::eevee::SyncModule::sync_point_cloud().
| 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().
| void blender::eevee::VelocityModule::step_sync | ( | eVelocityStep | step, |
| float | time ) |
Definition at line 98 of file eevee_velocity.cc.
References blender::draw::curves_free(), blender::draw::curves_init(), blender::draw::curves_update(), blender::eevee::Instance::depsgraph, DRW_render_object_iter(), geometry_steps_fill(), blender::draw::hair_free(), blender::draw::hair_init(), blender::draw::hair_update(), blender::eevee::Instance::manager, object_steps_usage, blender::eevee::Instance::render, blender::math::step(), step_camera_sync(), and blender::eevee::step_object_sync_render().
Referenced by blender::eevee::MotionBlurModule::init(), init(), and blender::eevee::MotionBlurModule::step().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
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().
| 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().
| 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().