|
Blender V5.0
|
#include <overlay_sculpt.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| void | begin_sync (Resources &res, const State &state) final |
| void | object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final |
| void | curves_sync (Manager &manager, const ObjectRef &ob_ref, const State &state) |
| void | mesh_sync (Manager &manager, const ObjectRef &ob_ref, const State &state) |
| void | draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final |
| void | draw_on_render (gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final |
Display sculpt modes overlays. Covers face sets and mask for meshes. Draw curve cages (curve guides) for curve sculpting.
Definition at line 34 of file overlay_sculpt.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 48 of file overlay_sculpt.hh.
References DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ALPHA, DRW_STATE_BLEND_MUL, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, ELEM, blender::draw::overlay::Overlay::enabled_, OB_MODE_SCULPT, OB_MODE_SCULPT_CURVES, OVERLAY_GLOBALS_SLOT, and state.
|
inline |
Definition at line 123 of file overlay_sculpt.hh.
References blender::draw::curves_sub_pass_setup(), blender::draw::DRW_curves_batch_cache_get_sculpt_curves_cage(), blender::draw::DRW_curves_texture_for_evaluated_attribute(), DRW_object_get_data_for_drawing(), error(), blender::draw::ObjectRef::object, state, and blender::draw::Manager::unique_handle().
Referenced by object_sync().
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 238 of file overlay_sculpt.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
inlinefinalvirtual |
Drawing can be split into multiple passes. Each callback draws onto a specific frame-buffer. The order between each draw function is guaranteed. But it is not guaranteed that no other overlay will render in between. The overlay can render to a temporary frame-buffer before resolving to the given frame-buffer.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 247 of file overlay_sculpt.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
inline |
Definition at line 159 of file overlay_sculpt.hh.
References Geometry::attributes, batch, BKE_sculptsession_use_pbvh_draw(), BLI_assert_unreachable, bm, SculptSession::bm, blender::bke::pbvh::BMesh, CD_PROP_FLOAT, CustomData_has_layer_named(), DEG_get_original(), blender::draw::DRW_mesh_batch_cache_get_sculpt_overlays(), DRW_object_get_data_for_drawing(), blender::bke::pbvh::Grids, Array< T, InlineBufferCapacity, Allocator >::is_empty(), SubdivCCG::masks, blender::bke::pbvh::Mesh, blender::draw::ObjectRef::object, blender::bke::object::pbvh_get(), Object::sculpt, blender::draw::SCULPT_BATCH_DEFAULT, blender::draw::SCULPT_BATCH_FACE_SET, blender::draw::SCULPT_BATCH_MASK, blender::draw::sculpt_batches_get(), state, SculptSession::subdiv_ccg, blender::draw::Manager::unique_handle(), and blender::draw::Manager::unique_handle_for_sculpt().
Referenced by object_sync().
|
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 104 of file overlay_sculpt.hh.
References curves_sync(), blender::draw::overlay::Overlay::enabled_, mesh_sync(), OB_CURVES, OB_MESH, and state.
Referenced by blender::draw::overlay::Instance::object_sync().