-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Description
Tested versions
- Reproducible in 4.5-stable, 4.6.beta1
- Not reproducible in 4.4-stable
I believe the reason this is not reproducible in <= 4.4 is because the engine was misreporting draw calls prior to a fix that was done in 4.4. Can't seem to find the issue right now but I will link it if I do.
System information
Godot v4.6.beta1 - Windows 11 (build 26200) - Multi-window, 2 monitors - Direct3D 12 (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 32.0.15.9144) - 12th Gen Intel(R) Core(TM) i5-12500H (16 threads) - 15.67 GiB memory
Issue description
When a mesh has multiple material slots and at least 2 of those slots have transparent materials with depth pre-pass on (or full alpha), draw call batching gets broken. It does not get broken if the mesh has multiple opaque slots and a single transparent material slot.
This may not be a bug, but rather something I am misunderstanding with the render pipeline. I was messing around with the engine using break points around the sortation code and could not find why exactly this is happening.
Test 1: a single material slot with transparency (red), the white and black materials are solid. Batching works
Test 2: both the red and black materials have an alpha of 0.50. The white material is solid. Batching breaks:
Steps to reproduce
Create a mesh and add multiple materials. If at least 2 material slots are transparent, batching seems to break
Minimal reproduction project (MRP)
MRP contains the blender file that was used as well.
mrp.zip