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

#include <overlay_background.hh>

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

Public Member Functions

void begin_sync (Resources &res, const State &state) final
void draw_output (Framebuffer &framebuffer, Manager &manager, View &view) final
void draw_vignette (Framebuffer &framebuffer, Manager &manager, View &view)

Detailed Description

Draw background color .

Definition at line 22 of file overlay_background.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Background::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 30 of file overlay_background.hh.

References BG_CHECKER, BG_GRADIENT, BG_MASK, BG_RADIAL, BG_SOLID, BG_SOLID_CHECKER, blender::Span< T >::data(), DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ALPHA, DRW_STATE_BLEND_BACKGROUND, DRW_STATE_BLEND_MUL, DRW_STATE_CULL_BACK, DRW_STATE_WRITE_COLOR, GPU_PRIM_TRIS, OB_SOLID, OVERLAY_GLOBALS_SLOT, state, TH_BACKGROUND_GRADIENT_LINEAR, TH_BACKGROUND_GRADIENT_RADIAL, TH_BACKGROUND_SINGLE_COLOR, TH_BACKGROUND_TYPE, UI_GetThemeValue(), UNPACK3, V3D_SHADING_BACKGROUND_VIEWPORT, and V3D_SHADING_BACKGROUND_WORLD.

◆ draw_output()

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

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

Definition at line 125 of file overlay_background.hh.

References view.

◆ draw_vignette()

void blender::draw::overlay::Background::draw_vignette ( Framebuffer & framebuffer,
Manager & manager,
View & view )
inline

Definition at line 131 of file overlay_background.hh.

References blender::draw::Manager::submit(), and view.


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