I would like to render a transparent queue that also does LEqual test.
The Shader sets the ZTest to LEQual, howerver, the Transparent object draw command buffer, seem to override it to always.
How can I render a transparent material in the transparent queue, that doesn’t ignore the LEqual ZTest?
Hi, have you enabled ZWrite in the shader (or force depth write in shader graph)?
I tired, but it’s not really related. I need ZTest not ZWrite
Edit: Transparent renderer buffer is set to ZTest Always, so I am guessing it is overriding everything under it. I have no other explanation.
Are you doing custom transparent objects rendering in a renderer feature?
If transparent objects are inside “DrawTransparentObjects” in URP Frame Debugger, you can achieve what you need by setting ZTest to LEqual in shader.

If no (custom rendering), you can override the depth state of the whole pass with RenderStateBlock in your custom renderer feature.
The ZTest is ignored in the shader graph.
Maybe I need to update Unity version.
As you can see, the transparent web completely ignores the ZTest.
Have you checked the depth render target in Frame Debugger?
If ZTest is set to LEqual there and you can see transparent objects in depth RT (when ZWrite On), then there should be nothing wrong with Unity. If not, yes you can try upgrading Unity.
By the way, as the spider web is not a semi-transparent object. You can also use alpha clipping for 0/1 transparency. Alpha clipping objects are considered as opaque so you won’t need to upgrade URP.
Ok, it worked after updating to 2022.
1 Like