Blender V5.0
blender::draw::overlay::Wireframe Class Reference

#include <overlay_wireframe.hh>

Inherits blender::draw::overlay::Overlay.

Public Member Functions

void begin_sync (Resources &res, const State &state) final
void object_sync_ex (Manager &manager, const ObjectRef &ob_ref, Resources &res, const State &state, const bool in_edit_paint_mode, const bool in_edit_mode)
void pre_draw (Manager &manager, View &view) final
void copy_depth (TextureRef &depth_tx)
void draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final

Detailed Description

Draw wireframe of objects.

The object wireframe can be drawn because of:

Definition at line 32 of file overlay_wireframe.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Wireframe::begin_sync ( Resources & ,
const State &  )
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 51 of file overlay_wireframe.hh.

References DRW_CLIPPING_UBO_SLOT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_FIRST_VERTEX_CONVENTION, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, G, G_TRANSFORM_OBJ, blender::gpu::StaticShader::get(), name, OVERLAY_GLOBALS_SLOT, state, U, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, blender::draw::overlay::ShaderModule::wireframe_curve, blender::draw::overlay::ShaderModule::wireframe_mesh, and blender::draw::overlay::ShaderModule::wireframe_points.

◆ copy_depth()

void blender::draw::overlay::Wireframe::copy_depth ( TextureRef & depth_tx)
inline

◆ draw_line()

void blender::draw::overlay::Wireframe::draw_line ( Framebuffer & framebuffer,
Manager & manager,
View & view )
inlinefinalvirtual

◆ object_sync_ex()

◆ pre_draw()

void blender::draw::overlay::Wireframe::pre_draw ( Manager & ,
View &  )
inlinefinalvirtual

Warms PassMain and PassSortable to avoid overhead of pipeline switching. Should only contains calls to generate_commands. NOTE: view is guaranteed to be the same view that will be passed to the draw functions.

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 246 of file overlay_wireframe.hh.

References blender::draw::overlay::Overlay::enabled_, and view.


The documentation for this class was generated from the following file: