During my current work I encountered the following problem:
I want to fake reflections by mirroring objects downwards and putting a plane between them with 90% opacity. So the mirrored objects can be slightly seen through the ground.
But if I do this with an object that already has transparency itself, the “reflection object” below the ground plane will ignore the plane and will be fully visible.
Looks like a problem with the z buffer or something similar. If I change the camera position to a higher angle it will suddenly work and show the objects below the plane correctly.
Can someone help me with this problem to display these objects correctly?
Alpha blended shaders do not write into the Z buffer, therefore the engine is not sure which one to render first in the queue and it will inevitably render them in an undesired order sometimes.
To fight this you can add custom render queue tags to your shaders, for instance the Transparent shader uses:
Tags {"Queue"="Transparent"}
To make sure your transparent floor always rendered on top of other transparent objects you’d change the line to:
Tags {"Queue"="Transparent+1"}
The +1 puts it further back in the render queue so that it always renders after the Transparent queue. If you need further assistance I’d be happy to set up a little example scene.
Ethan
Thanks, that did work for me
Now everything is working fine.