Overlay-Next: Initial implementation #107045
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
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.
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).
# Conflicts: # source/blender/draw/engines/select/select_engine.c # source/blender/draw/engines/select/shaders/infos/select_id_info.hh
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?
Pull request closed
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?