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
f0514484f5 DRW: Wrappers: Add TextureRef to wrap around GPUTexture pointers
This adds the possibility to use the C++ API for other GPUTexture.
968f5748c6 Merge branch 'main' into overlay-next
# Conflicts:
#	release/scripts/startup/bl_ui/space_userpref.py
#	source/blender/makesdna/DNA_userdef_types.h
#	source/blender/makesrna/intern/rna_userdef.c
cdb9b6a041 Overlay-Next: Add support for empties
Also added a shape cache and move the color selection to `Resources`.
ef0126f3a7 Merge branch 'main' into overlay-next
# Conflicts:
#	source/blender/makesdna/DNA_userdef_types.h
84ff44769f Overlay-Next: Add high level separation of selection code
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).
78ae27bab3 Overlay-Next: Add depth Prepass basics
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
16cc2446f5 Overlay-Next: Add shader module
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.
ea66898bbe Select-Next: Introduce shader level patching to output selection ids
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).
3ac54f67bf Select-Next: Add result buffer injection
This allow compatibility with the old system.
7676b627c2 Merge branch 'main' into overlay-next
# 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
EEVEE & Viewport
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 EEVEE & Viewport 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 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 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.