I can’t get Blended Alpha to reliable stack in the correct order.
I have a character 2D cut out character and the minute I set up the blending for alpha over behaviour on both the head and the eyeballs, as well as giving them both access to read and write from depth, and I have alpha test off; it’s losing the natural Y axis depth set up in my scene in the way I have my objects stacked in front of the camera.
I have event tried sorting elements.
I just can’t get this to reliable sort blended alpha properly.
I came up with a ‘A’ solution to this. It’s not an ideal one because it means additional draw calls.
To get the look of a Spine character in your game engine the only thing I can think of to reliably stack alpha blended materials is to keep the character in parts, use sorting index on each mesh and avoid batching the meshes. Then:
-Tick depth texture in the render settings
-Ensure ‘batch meshes’ is off.
-Under: Armory Render Path/Render:
Renderer: ‘Forward Clustered.’
Materials: (This can be set to solid for Spine-like behaviour)
Blending: ON: This must be on for alpha blend, multiply, add etc.
Depth Texture: ON.
Draw Order: Index (Per object setting)
-For each object, under: ‘Object Properties’ / ‘Armory Props’ ‘Sorting Index’;
Assign a independent ‘Sorting index value’. Then look at the materials settings.
-For each object’s materials settings, under ‘Armory Props’ settings:
Cast Shadow: OFF
Receive Shadow: OFF
Read Depth: ON
Draw Depth: ON
Alpha Test: OFF
Blending: ON
BLENDING (For regular Alpha over):
Source = SourceAlpha,
Destination = InverseSourceAlpha
Operation = Add
Source (Alpha) = One
Destination (Alpha) = Inverse Source Alpha
Operation (Alpha) = Add
What I’m interested in before I consider this properly solved:
Is there a way to batch models in geo nodes where the index is stored as an attribute and accessed to draw things in the right order?
Essentially, I still want to be able to batch meshes AND get my meshes ordered correctly.
For now I will continue on with my project.
Would love to hear from someone on this.