I’m trying to create/find a shader where some transparent elements, placed on top of each other, will not mix together. The result should still be transparent, but the colors should not mix; only the top layer should contribute the color.
What techniques are available for this? I’m guessing the ordinary cutout shaders will kill all semi-transparency, and z-buffer isn’t available for transparent shaders anyway? Some sort of stencil buffer maybe? It needs to work in URP.
Before rendering transparent materials render top layer with fully transparent material but with z-write enabled.
This will cover all later transparent material that are inside.
Render all your transparent materials, but the topmost layer with z-test LEqual (this actually should be default)