|
Blender V5.0
|
#include <overlay_mode_transfer.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 | draw (Framebuffer &framebuffer, Manager &manager, View &view) final |
Make newly active mesh flash for a brief period of time. This can be triggered using the "Transfer Mode" operator when in any edit mode.
Definition at line 26 of file overlay_mode_transfer.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 13 of file overlay_mode_transfer.cc.
References blender::draw::overlay::Resources::clip_planes_buf, DRW_CLIPPING_UBO_SLOT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, blender::gpu::StaticShader::get(), blender::draw::overlay::Resources::globals_buf, blender::draw::overlay::Resources::is_selection(), blender::ed::object::mode_transfer_overlay_current_state(), OVERLAY_GLOBALS_SLOT, blender::draw::overlay::Resources::shaders, srgb_to_linearrgb_v4(), state, TH_VERTEX_SELECT, UI_GetThemeColor3fv(), and blender::draw::overlay::ShaderModule::uniform_color.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 80 of file overlay_mode_transfer.hh.
References DRW_viewport_request_redraw(), 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 37 of file overlay_mode_transfer.hh.
References batch, BKE_sculptsession_use_pbvh_draw(), blender::draw::DRW_cache_object_surface_get(), DRW_object_is_renderable(), blender::draw::overlay::Overlay::enabled_, OB_WIRE, blender::draw::SCULPT_BATCH_DEFAULT, blender::draw::sculpt_batches_get(), and state.
Referenced by blender::draw::overlay::Instance::object_sync().