|
Blender V5.3
|
#include <overlay_mesh.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| void | begin_sync (Resources &res, const State &state) final |
| void | edit_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final |
| void | draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final |
| void | draw_line_only (Framebuffer &framebuffer, Manager &manager, View &view) final |
Static Public Member Functions | |
| static bool | mesh_has_edit_cage (const Object *ob) |
Draw edit mesh overlays.
Definition at line 47 of file overlay_mesh.hh.
|
inlinefinalvirtual |
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 97 of file overlay_mesh.hh.
References blender::draw::detail::PassBase< DrawCommandBufType >::bind_texture(), blender::draw::detail::PassBase< DrawCommandBufType >::bind_ubo(), DRW_CLIPPING_UBO_SLOT, blender::DRW_STATE_BLEND_ALPHA, blender::DRW_STATE_CULL_BACK, blender::DRW_STATE_DEPTH_LESS_EQUAL, blender::DRW_STATE_FIRST_VERTEX_CONVENTION, blender::DRW_STATE_WRITE_COLOR, blender::DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, blender::gpu::shader::metadata::float3, blender::GPU_use_hq_normals_workaround(), blender::draw::detail::Pass< DrawCommandBufType >::init(), blender::gpu::shader::metadata::int4, blender::math::normalize(), blender::OB_WIRE, OVERLAY_GLOBALS_SLOT, blender::draw::detail::PassBase< DrawCommandBufType >::push_constant(), RETOPOLOGY_OFFSET, blender::SCE_PERF_HQ_NORMALS, blender::SCE_SELECT_EDGE, blender::SCE_SELECT_FACE, blender::SCE_SELECT_VERTEX, blender::ToolSettings::selectmode, blender::draw::detail::PassBase< DrawCommandBufType >::shader_set(), state, blender::draw::detail::PassBase< DrawCommandBufType >::state_set(), blender::U, blender::USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE, blender::V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS, blender::V3D_OVERLAY_EDIT_FACE_DOT, blender::V3D_OVERLAY_EDIT_FACE_NORMALS, blender::V3D_OVERLAY_EDIT_FACES, blender::V3D_OVERLAY_EDIT_LOOP_NORMALS, blender::V3D_OVERLAY_EDIT_RETOPOLOGY, blender::V3D_OVERLAY_EDIT_STATVIS, blender::V3D_OVERLAY_EDIT_VERT_NORMALS, and blender::V3D_OVERLAY_EDIT_WEIGHT.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 384 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, blender::GPU_debug_group_begin(), blender::GPU_debug_group_end(), and blender::GPU_framebuffer_bind().
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 418 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, blender::GPU_debug_group_begin(), blender::GPU_debug_group_end(), and blender::GPU_framebuffer_bind().
|
inlinefinalvirtual |
Fills passes or buffers for each object in edit mode. Runs for each individual object state for a specific mode. 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 304 of file overlay_mesh.hh.
References blender::BKE_subsurf_modifier_has_gpu_subdiv(), blender::draw::DRW_cache_mesh_surface_get(), blender::draw::DRW_cache_mesh_surface_mesh_analysis_get(), blender::draw::DRW_cache_mesh_surface_weights_get(), blender::draw::DRW_mesh_batch_cache_get_edit_edges(), blender::draw::DRW_mesh_batch_cache_get_edit_facedots(), blender::draw::DRW_mesh_batch_cache_get_edit_loop_normals(), blender::draw::DRW_mesh_batch_cache_get_edit_skin_roots(), blender::draw::DRW_mesh_batch_cache_get_edit_triangles(), blender::draw::DRW_mesh_batch_cache_get_edit_vert_normals(), blender::draw::DRW_mesh_batch_cache_get_edit_vertices(), blender::DRW_object_get_data_for_drawing(), blender::DRW_text_edit_mesh_measure_stats(), blender::Object::dt, blender::draw::overlay::Overlay::enabled_, blender::GPU_PRIM_LINES, blender::GPU_PRIM_TRIS, mesh_has_edit_cage(), blender::OB_WIRE, blender::draw::overlay::overlay_edit_text, and state.
|
inlinestatic |
Definition at line 448 of file overlay_mesh.hh.
References blender::BKE_object_get_editmesh_eval_cage(), blender::BKE_object_get_editmesh_eval_final(), blender::BLI_assert(), blender::DRW_object_get_data_for_drawing(), blender::OB_MESH, and blender::Object::type.
Referenced by edit_object_sync().