Draw-Manager: Allow independent gizmo redraws #73198

Open
opened 2020-01-17 15:49:16 +01:00 by Julian Eisel · 8 comments
Member

Draw-Manager: Allow independent gizmo redraws

Motivation

Currently, to redraw a gizmo, we have to redraw the entire viewport. So whenever a gizmo changes highlight state, visiblity state or any other visual state, the entire viewport is redrawn. This may be a very expensive operation that we should definitely try to avoid.

For the first XR milestone (#71347), we further want to introduce gizmos to viewports that give feedback on the VR session. For example gizmos indicating the position and rotation of the VR camera and the controllers. They would have to be constantly redrawn at a rather high rate to be useful. Redrawing the entire viewport for this takes many resources needed for the VR view rendering.
This is such a gizmo, it currently requires redrawing the entire viewport for every frame:

06_vr_view_gizmo_update.m4v

Basic Proposal

It would be nice if we could just render gizmos into a separate framebuffer and overlay that on top of the viewport, so that both can be updated independently. Integrating the gizmo drawing with the draw-manager passes and compositing would be quite difficult, and brings its own overhead (re-running draw loop, managing passes, compositing, ...).

@Jeroen-Bakker suggested to instead blit the default framebuffer into a separate one before gizmos are drawn. That one can then be kept around and re-used to redraw the gizmos on top, whenever they changed visual state.
We'll also need to redraw 2D annotations and region info (cursor, render border, view-axis, FPS text, etc) then, since they draw in-between 3D and 2D gizmos. Doing so isn't that expensive though.

We may want to have an option to use the old full-redraw behavior over the more performant one, as the latter is heavier on GPU memory.

# Draw-Manager: Allow independent gizmo redraws ## Motivation Currently, to redraw a gizmo, we have to redraw the entire viewport. So whenever a gizmo changes highlight state, visiblity state or any other visual state, the entire viewport is redrawn. This may be a very expensive operation that we should definitely try to avoid. For the first XR milestone (#71347), we further want to introduce gizmos to viewports that give feedback on the VR session. For example gizmos indicating the position and rotation of the VR camera and the controllers. They would have to be constantly redrawn at a rather high rate to be useful. Redrawing the entire viewport for this takes many resources needed for the VR view rendering. This is such a gizmo, it currently requires redrawing the entire viewport for every frame: [06_vr_view_gizmo_update.m4v](https://archive.blender.org/developer/F8283190/06_vr_view_gizmo_update.m4v) ## Basic Proposal It would be nice if we could just render gizmos into a separate framebuffer and overlay that on top of the viewport, so that both can be updated independently. Integrating the gizmo drawing with the draw-manager passes and compositing would be quite difficult, and brings its own overhead (re-running draw loop, managing passes, compositing, ...). @Jeroen-Bakker suggested to instead blit the default framebuffer into a separate one before gizmos are drawn. That one can then be kept around and re-used to redraw the gizmos on top, whenever they changed visual state. We'll also need to redraw 2D annotations and region info (cursor, render border, view-axis, FPS text, etc) then, since they draw in-between 3D and 2D gizmos. Doing so isn't that expensive though. We may want to have an option to use the old full-redraw behavior over the more performant one, as the latter is heavier on GPU memory.
Author
Member

Added subscribers: @Jeroen-Bakker, @JulianEisel, @fclem

Added subscribers: @Jeroen-Bakker, @JulianEisel, @fclem

Added subscriber: @ThatAsherGuy

Added subscriber: @ThatAsherGuy

We plan to use a similar scheme for the main viewport itself. Having only the overlays and/or the gizmos redrawn on top of the cached render.

We plan to use a similar scheme for the main viewport itself. Having only the overlays and/or the gizmos redrawn on top of the cached render.

Added subscriber: @nokipaike

Added subscriber: @nokipaike

just out of curiosity, is this bug #72968 a similar problem?

just out of curiosity, is this bug #72968 a similar problem?

In #73198#852359, @nokipaike wrote:
just out of curiosity, is this bug #72968 a similar problem?

It could fix it but would not fix the core issue.

> In #73198#852359, @nokipaike wrote: > just out of curiosity, is this bug #72968 a similar problem? It could fix it but would not fix the core issue.

Added subscriber: @MiroHorvath

Added subscriber: @MiroHorvath
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:15:12 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#73198
No description provided.