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

#include <overlay_prepass.hh>

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

Public Member Functions

void begin_sync (Resources &res, const State &state) final
void draw_on_render (gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final

Detailed Description

Definition at line 26 of file overlay_prepass.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::ImagePrepass::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 31 of file overlay_prepass.hh.

References DRW_STATE_DEPTH_ALWAYS, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, and state.

◆ draw_on_render()

void blender::draw::overlay::ImagePrepass::draw_on_render ( gpu::FrameBuffer * ,
Manager & ,
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 46 of file overlay_prepass.hh.

References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.


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