Overlay-Next: Initial implementation #107045

Closed
Clément Foucault wants to merge 28 commits from fclem/blender:overlay-next into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

This contains the basis of the new overlay engine.
Only a few overlays are ported for proof of concept of the new design.

This new design unify the selection drawing with the overlay-next engine.
It now becomes responsible of selection in object mode.

For this we create a dedicated shader module that patches the shaders
for selection. The overlay engine codeflow should be fairly the same
as for both selection and regular drawing.

Note that the gizmo selection still uses the occlusion queries and edit-mode
the current selection engine (select_engine.c). These are out of the scope
of this refactor.

Another major difference in design with the current (old) overlay engine is
the entity type structure (Object, Empties, MetaBall etc...) instead of
drawing type centric (Extras, ). This is to increase code readablility and
locality. Each

The GPUBatches for each overlay are put inside a per instance batch
cache. This is redundant but avoid concurent usage and relying on a
global state. This is a few KB of data at most and will not produce
any significant slowdown on startup.

Related task #102179
Related task #102177

This contains the basis of the new overlay engine. Only a few overlays are ported for proof of concept of the new design. This new design unify the selection drawing with the overlay-next engine. It now becomes responsible of selection in object mode. For this we create a dedicated shader module that patches the shaders for selection. The overlay engine codeflow should be fairly the same as for both selection and regular drawing. Note that the gizmo selection still uses the occlusion queries and edit-mode the current selection engine (`select_engine.c`). These are out of the scope of this refactor. Another major difference in design with the current (old) overlay engine is the entity type structure (Object, Empties, MetaBall etc...) instead of drawing type centric (Extras, ). This is to increase code readablility and locality. Each The `GPUBatch`es for each overlay are put inside a per instance batch cache. This is redundant but avoid concurent usage and relying on a global state. This is a few KB of data at most and will not produce any significant slowdown on startup. Related task #102179 Related task #102177
Clément Foucault added 28 commits 2023-04-17 17:38:47 +02:00
This adds the possibility to use the C++ API for other GPUTexture.
# Conflicts:
#	release/scripts/startup/bl_ui/space_userpref.py
#	source/blender/makesdna/DNA_userdef_types.h
#	source/blender/makesrna/intern/rna_userdef.c
Also added a shape cache and move the color selection to `Resources`.
# Conflicts:
#	source/blender/makesdna/DNA_userdef_types.h
This makes it possible to reuse the overlay engine code for selection
purpose, but without any overhead for the viewport drawing.

The separation is made clear by having a dummy selection implementation for
viewport drawing and an object implementation for object selection.
Other impementation might come later (like for depth picking).
The depth prepass is supposed to replace the Basic engine:
- Draw object depth when the engine doesn't give correct depth buffer
- Used for object selection
This allows cleaner declarations of shaders as well as allowing easier
swapping of the whole shader module for selection & clipping.

This also allow to easier toggle between the old overlay engine and
overlay-next as they don't share the same shaders anymore.
This leverage imageLoad/Store operations to remove the use of cumbersome
visibility queries.

Patching shaders should only require 4 lines of code (2 for includes, 2 for
the id passthrough).
This allow compatibility with the old system.
# Conflicts:
#	source/blender/draw/engines/select/select_engine.c
#	source/blender/draw/engines/select/shaders/infos/select_id_info.hh
Clément Foucault requested review from Jeroen Bakker 2023-04-17 17:53:55 +02:00
Clément Foucault requested review from Miguel Pozo 2023-04-17 17:53:55 +02:00
Clément Foucault added the
Module
Viewport & EEVEE
label 2023-04-17 17:54:04 +02:00
Clément Foucault added this to the 4.0 milestone 2023-04-17 17:54:08 +02:00
Clément Foucault added this to the Viewport & EEVEE project 2023-04-17 17:54:14 +02:00
Member

I did a quick scan. Seems like it uses templates to switch out resources/shaders so the different overlays don't need to many changes. Think it is a good idea. Still need to look at the selection shaders how that is setup.

I did a quick scan. Seems like it uses templates to switch out resources/shaders so the different overlays don't need to many changes. Think it is a good idea. Still need to look at the selection shaders how that is setup.

I guess this was replaced by #107734, and can be closed now?

I guess this was replaced by #107734, and can be closed now?

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 Assignees
3 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#107045
No description provided.