|
Blender V5.0
|
#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 484 of file overlay_mesh.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 548 of file overlay_mesh.hh.
References BKE_paint_brush_for_read(), ImagePaintSettings::clone, DEG_get_evaluated(), MaskSpaceInfo::draw_flag, DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ALPHA, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, SpaceImage::dt_uvstretch, ELEM, blender::draw::overlay::Overlay::enabled_, SpaceImage::flag, IMA_SRC_TILED, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT, SpaceImage::image, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_CLONE, ToolSettings::imapaint, M_SQRT2, MaskSpaceInfo::mask, MASK_DRAWFLAG_OVERLAY, SpaceImage::mask_info, SpaceImage::mode, OB_MODE_EDIT, OVERLAY_GLOBALS_SLOT, MaskSpaceInfo::overlay_mode, ImagePaintSettings::paint, SCE_SELECT_FACE, SCE_SELECT_VERTEX, ToolSettings::selectmode, SI_DRAW_STRETCH, SI_DRAWSHADOW, SI_MODE_MASK, SI_MODE_PAINT, SI_MODE_UV, SI_NO_DRAW_UV_GUIDE, SI_NO_DRAWFACES, SI_UVDT_STRETCH_ANGLE, Image::source, srgb_to_linearrgb_v4(), state, SpaceImage::stretch_opacity, TH_FACEDOT_SIZE, TH_VERTEX, TH_VERTEX_SIZE, Image::type, U, UI_GetThemeColor4fv(), UI_GetThemeValuef(), UI_SCALE_FAC, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, SpaceImage::uv_face_opacity, ToolSettings::uv_flag, UV_FLAG_SELECT_SYNC, SpaceImage::uv_opacity, UV_SELECT_EDGE, UV_SELECT_FACE, ToolSettings::uv_selectmode, ToolSettings::uv_sticky, and UV_STICKY_VERT.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 1026 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_debug_group_begin(), GPU_debug_group_end(), GPU_framebuffer_bind(), MASK_OVERLAY_COMBINED, 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 1066 of file overlay_mesh.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), MASK_OVERLAY_COMBINED, and view.
|
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 801 of file overlay_mesh.hh.
References CD_PROP_FLOAT2, Mesh::corner_data, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT, CustomData_get_active_layer(), Object::data, 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(), DRW_object_get_data_for_drawing(), DRW_object_is_in_edit_mode(), Mesh::editflag, ELEM, blender::draw::overlay::Overlay::enabled_, GPU_PRIM_TRIS, ME_EDIT_PAINT_FACE_SEL, SpaceImage::mode, OB_MESH, Mesh::runtime, SI_MODE_UV, SI_UVDT_STRETCH_ANGLE, SI_UVDT_STRETCH_AREA, state, Object::type, and SpaceImage::uv_face_opacity.
Referenced by blender::draw::overlay::Instance::object_sync().
Finalize passes or buffers used for object sync. Runs once at the start of the sync cycle.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 901 of file overlay_mesh.hh.
References Image::active_tile_index, BKE_image_get_gpu_texture(), BKE_image_get_size_fl(), MaskSpaceInfo::blend_factor, ImagePaintSettings::clone, ImagePaintSettings::clone_alpha, ImagePaintSettings::clone_offset, draw_tile(), DRW_STATE_BLEND_ALPHA, DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_BLEND_MUL, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_WRITE_COLOR, DRW_text_cache_add(), DRW_TEXT_CACHE_GLOBALSPACE, blender::draw::overlay::Overlay::enabled_, SpaceImage::image, ToolSettings::imapaint, blender::draw::Texture::is_valid(), SpaceImage::mask_info, MASK_OVERLAY_COMBINED, blender::math::safe_rcp(), blender::draw::Texture::size(), srgb_to_linearrgb_v4(), state, TH_BACK, TH_FACE_SELECT, tile, tile_index, Image::tiles, tiles, UI_GetThemeColor4fv(), UI_GetThemeColorShade4fv(), UI_GetThemeColorShade4ubv(), blender::draw::TextureRef::wrap(), and blender::VecBase< T, Size >::xy().
|
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 771 of file overlay_mesh.hh.
References BASE_SELECTED, CD_PROP_FLOAT2, Mesh::corner_data, CustomData_get_active_layer(), blender::draw::DRW_mesh_batch_cache_get_all_uv_wireframe(), blender::draw::DRW_mesh_batch_cache_get_uv_faces(), DRW_object_get_data_for_drawing(), blender::draw::overlay::Overlay::enabled_, GPU_PRIM_TRIS, OB_MESH, state, and SpaceImage::uv_face_opacity.
Referenced by blender::draw::overlay::Instance::object_sync().