The built-in renderer does not cull kShadowCastingShadowsOnly objects for the Projector render loop in 2021.3, which can result in several issues if those features are in-use:
- Wrong visuals as materials can be applied multiple times
- Floating/intersecting transparent geometry or Z-fighting depending on what the shadow-caster is and what the depth test type is
- A performance regression in 2021+ due to additional geometry being rendered
This was noticed in VRChat on 2021.3 where the player avatar's shadow casting mesh visibly z-fights with the visible mesh under certain projectors when using an Equals z-test with no depth bias.
The issues looks like it was introduced in [Internal link] where some culling of kShadowCastingShadowsOnly nodes was moved to a scriptable render loop file without anything to cover the built-in renderer.
Repro project attached which demonstrates multiple application of materials, shown as the objects being incorrectly coloured in 2021.3+.
- Load SampleScene in 2019.4 to see the correct visual
- Load SampleScene in 2021.3 or later to see the doubling of materials
The original:
The multiplied effect with a depth-equals test: