|
Blender V5.0
|
#include <overlay_prepass.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| void | begin_sync (Resources &res, const State &state) final |
| void | particle_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) |
| void | sculpt_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res) |
| void | object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state) final |
| void | pre_draw (Manager &manager, View &view) final |
| void | draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final |
A depth pass that write surface depth when it is needed. It is also used for selecting non overlay-only objects.
Definition at line 61 of file overlay_prepass.hh.
Synchronization creates and fill render passes based on context state and scene state.
It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.
IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).
This method must be implemented.
Implements blender::draw::overlay::Overlay.
Definition at line 74 of file overlay_prepass.hh.
References DRW_CLIPPING_UBO_SLOT, DRW_STATE_CULL_BACK, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, OVERLAY_GLOBALS_SLOT, and state.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 320 of file overlay_prepass.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
inlinefinalvirtual |
Fills passes or buffers for each object. Runs for each individual object state. IMPORTANT: Can run only once for instances using the same state (ObjectRef might contains instancing data).
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 192 of file overlay_prepass.hh.
References BKE_object_material_used_with_fallback_eval(), BKE_sculptsession_use_pbvh_draw(), blender::draw::curves_sub_pass_setup(), blender::draw::detail::PassBase< DrawCommandBufType >::draw(), blender::draw::detail::PassBase< DrawCommandBufType >::draw_expand(), blender::draw::DRW_cache_mesh_all_edges_get(), blender::draw::DRW_cache_mesh_surface_get(), blender::draw::DRW_cache_mesh_surface_shaded_get(), blender::draw::DRW_cache_volume_selection_surface_get(), blender::draw::overlay::Overlay::enabled_, error(), blender::draw::overlay::FlatObjectRef::flat_axis_index_get(), blender::draw::select::ID::get(), GPU_PRIM_TRIS, blender::Span< T >::index_range(), OB_CURVES, OB_GREASE_PENCIL, OB_HIDE_CAMERA, OB_MESH, OB_POINTCLOUD, OB_RENDER, OB_SOLID, OB_VOLUME, particle_sync(), blender::draw::pointcloud_sub_pass_setup(), sculpt_sync(), and state.
Referenced by blender::draw::overlay::Instance::object_sync().
|
inline |
Definition at line 131 of file overlay_prepass.hh.
References ParticleSettings::draw_as, blender::draw::DRW_cache_particles_get_hair(), DRW_object_is_visible_psys_in_active_context(), blender::draw::select::ID::get(), blender::draw::ResourceHandleRange::is_valid(), LISTBASE_FOREACH, blender::draw::ObjectRef::object, ParticleSettings::omat, PART_DRAW_PATH, PART_DRAW_REND, blender::draw::ObjectRef::particles_matrix(), Object::particlesystem, ParticleSettings::ren_as, blender::draw::Manager::resource_handle_for_psys(), blender::draw::select::SelectMap::select_id(), and state.
Referenced by object_sync().
Warms PassMain and PassSortable to avoid overhead of pipeline switching. Should only contains calls to generate_commands. NOTE: view is guaranteed to be the same view that will be passed to the draw functions.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 311 of file overlay_prepass.hh.
References blender::draw::overlay::Overlay::enabled_, and view.
|
inline |
Definition at line 173 of file overlay_prepass.hh.
References batch, blender::draw::select::ID::get(), GPU_PRIM_TRIS, blender::draw::overlay::Resources::is_selection(), blender::draw::ObjectRef::object, blender::draw::SCULPT_BATCH_DEFAULT, blender::draw::sculpt_batches_get(), blender::draw::select::SelectMap::select_id(), and blender::draw::Manager::unique_handle_for_sculpt().
Referenced by object_sync().