|
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 | object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final |
| void | edit_object_sync (Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final |
| void | end_sync (Resources &res, const State &state) final |
| void | draw (Framebuffer &framebuffer, Manager &manager, View &view) final |
| void | draw_on_render (gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final |
Draw edit uv overlays.
Definition at line 494 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 558 of file overlay_mesh.hh.
References blender::BKE_paint_brush_for_read(), blender::ImagePaintSettings::clone, blender::DEG_get_evaluated(), blender::MaskSpaceInfo::draw_flag, DRW_CLIPPING_UBO_SLOT, blender::DRW_STATE_BLEND_ALPHA, blender::DRW_STATE_DEPTH_ALWAYS, blender::DRW_STATE_DEPTH_LESS_EQUAL, blender::DRW_STATE_WRITE_COLOR, blender::DRW_STATE_WRITE_DEPTH, blender::SpaceImage::dt_uvstretch, ELEM, blender::draw::overlay::Overlay::enabled_, blender::SpaceImage::flag, blender::gpu::shader::metadata::float4, blender::ui::theme::get_color_4fv(), blender::ui::theme::get_value_f(), blender::IMA_SRC_TILED, blender::IMA_TYPE_COMPOSITE, blender::IMA_TYPE_R_RESULT, blender::SpaceImage::image, blender::IMAGE_PAINT_BRUSH_TYPE_CLONE, blender::ToolSettings::imapaint, M_SQRT2, blender::MaskSpaceInfo::mask, blender::MASK_DRAWFLAG_OVERLAY, blender::SpaceImage::mask_info, blender::SpaceImage::mode, blender::OB_MODE_EDIT, OVERLAY_GLOBALS_SLOT, blender::MaskSpaceInfo::overlay_mode, blender::ImagePaintSettings::paint, blender::SCE_SELECT_FACE, blender::SCE_SELECT_VERTEX, blender::ToolSettings::selectmode, blender::SI_DRAW_STRETCH, blender::SI_DRAWSHADOW, blender::SI_MODE_MASK, blender::SI_MODE_PAINT, blender::SI_MODE_UV, blender::SI_NO_DRAW_UV_GUIDE, blender::SI_NO_DRAWFACES, blender::SI_UVDT_STRETCH_ANGLE, blender::srgb_to_linearrgb_v4(), state, blender::SpaceImage::stretch_opacity, blender::TH_FACEDOT_SIZE, blender::TH_VERTEX, blender::TH_VERTEX_SIZE, blender::U, UI_SCALE_FAC, blender::USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, blender::SpaceImage::uv_edge_opacity, blender::SpaceImage::uv_face_opacity, blender::ToolSettings::uv_flag, blender::UV_FLAG_SELECT_SYNC, blender::SpaceImage::uv_opacity, blender::UV_SELECT_EDGE, blender::UV_SELECT_FACE, blender::ToolSettings::uv_selectmode, blender::ToolSettings::uv_sticky, and blender::UV_STICKY_VERT.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 1046 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, blender::GPU_debug_group_begin(), blender::GPU_debug_group_end(), blender::GPU_framebuffer_bind(), and blender::MASK_OVERLAY_COMBINED.
|
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 1086 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, blender::GPU_framebuffer_bind(), and blender::MASK_OVERLAY_COMBINED.
|
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 814 of file overlay_mesh.hh.
References blender::BKE_editmesh_bmesh_get(), blender::bm, blender::CD_PROP_FLOAT2, blender::CTX_MODE_PAINT_TEXTURE, blender::CTX_MODE_PAINT_VERTEX, blender::CTX_MODE_PAINT_WEIGHT, blender::CustomData_has_layer_named(), blender::Object::data, blender::DEG_get_original(), blender::draw::DRW_mesh_batch_cache_get_all_uv_wireframe(), blender::draw::DRW_mesh_batch_cache_get_edituv_edges(), blender::draw::DRW_mesh_batch_cache_get_edituv_facedots(), blender::draw::DRW_mesh_batch_cache_get_edituv_faces(), blender::draw::DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(), blender::draw::DRW_mesh_batch_cache_get_edituv_faces_stretch_area(), blender::draw::DRW_mesh_batch_cache_get_edituv_verts(), blender::draw::DRW_mesh_batch_cache_get_edituv_wireframe(), blender::draw::DRW_mesh_batch_cache_get_uv_faces(), blender::draw::DRW_mesh_batch_cache_get_uv_wireframe(), blender::DRW_object_get_data_for_drawing(), blender::DRW_object_is_in_edit_mode(), blender::Mesh::editflag, ELEM, blender::draw::overlay::Overlay::enabled_, blender::GPU_PRIM_TRIS, blender::bke::mesh::is_uv_map(), blender::BMesh::ldata, blender::bke::AttributeAccessor::lookup_meta_data(), blender::ME_EDIT_PAINT_FACE_SEL, blender::SpaceImage::mode, blender::OB_MESH, blender::SI_MODE_UV, blender::SI_UVDT_STRETCH_ANGLE, blender::SI_UVDT_STRETCH_AREA, state, blender::Object::type, and blender::SpaceImage::uv_face_opacity.
|
inlinefinalvirtual |
Finalize passes or buffers used for object sync. Runs once at the end of the sync cycle.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 919 of file overlay_mesh.hh.
References blender::BKE_image_acquire_gpu_texture(), blender::BKE_image_get_size_fl(), blender::MaskSpaceInfo::blend_factor, blender::ImagePaintSettings::clone, blender::ImagePaintSettings::clone_alpha, blender::ImagePaintSettings::clone_offset, blender::DRW_manager_get(), blender::DRW_STATE_BLEND_ALPHA, blender::DRW_STATE_BLEND_ALPHA_PREMUL, blender::DRW_STATE_BLEND_MUL, blender::DRW_STATE_DEPTH_ALWAYS, blender::DRW_STATE_WRITE_COLOR, blender::DRW_text_cache_add(), blender::DRW_TEXT_CACHE_GLOBALSPACE, blender::draw::overlay::Overlay::enabled_, blender::gpu::shader::metadata::float2, blender::gpu::shader::metadata::float3, blender::gpu::shader::metadata::float4, blender::ui::theme::get_color_4fv(), blender::ui::theme::get_color_shade_4fv(), blender::ui::theme::get_color_shade_4ubv(), blender::draw::Manager::hold_texture(), blender::SpaceImage::image, blender::ToolSettings::imapaint, blender::draw::Texture::is_valid(), blender::SpaceImage::mask_info, blender::MASK_OVERLAY_COMBINED, blender::math::safe_rcp(), blender::draw::Texture::size(), blender::srgb_to_linearrgb_v4(), state, blender::TH_BACK, blender::TH_FACE_SELECT, tile, tile_index, tiles, and blender::draw::TextureRef::wrap().
|
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 781 of file overlay_mesh.hh.
References blender::BASE_SELECTED, blender::draw::DRW_mesh_batch_cache_get_all_uv_wireframe(), blender::draw::DRW_mesh_batch_cache_get_uv_faces(), blender::DRW_object_get_data_for_drawing(), blender::draw::overlay::Overlay::enabled_, blender::GPU_PRIM_TRIS, blender::bke::mesh::is_uv_map(), blender::bke::AttributeAccessor::lookup_meta_data(), blender::OB_MESH, state, and blender::SpaceImage::uv_face_opacity.