Do you know if there’s ever a time when ZTest Less is going to give different results than ZTest LEqual? I’m not talking about the cases where you’re using another pass in the same SubShader, where LEqual will yield the same results as Equal.
I tried a shader with a Ztest Less pass, and a Ztest Greater pass. I figured maybe there’d be some 1-pixel error with a plane intersecting the mesh; in this case, I used a near clip value of .01 and a far clip value of 99999, which is the maximum delta I can get before Unity throws errors and the camera fails to work at all. Even with the mesh right by the far clip plane, I couldn’t get any pixels from the plane to show up between the in-front and in-back sections of the mesh.
Furthermore, I can’t even get ZTest Equal to work when two polygons are coplanar - the Equal pass instead has to be in the same SubShader as another pass that used a different ZTest, in order for the Equal pass to show up.
To be clear, I don’t get the impression this is a bug. I just wonder if, in theory, ZTest Less and Ztest LEqual could yield different results under the most common circumstances. And is the reason that Ztest LEqual is the default, is that you can use it for all the passes in a shader, without having to define the ZTest?
Additionally, if you have any information on whether ZTest Less or ZTest Equal are measurably faster than ZTest LEqual (for the appropriate cases where results are identical), particularly for iOS devices, where things can behave strangely*, please let me know.
- I did some tests and noticed no performance change from using ZTest Always and ZWrite Off, in cases where the rendered results would be identical to those seen from the defaults, ZTest LEqual and ZWrite On.


