I am running in a bit of a problem rendering vegetation on screen. Its not even covering a lot of the screen, but the performance impact is quite high. The vegetation is rendered using alpha-testing, which causes a lot of overdraw. Other engines seem to take advantage of the depth pre-pass to depth-reject occluded pixels in the lit-shader passes, making it much more affordable.
From my tests and some vague posts I found about the topic, it seems that LWRP/URP doesn’t use the depth pre-pass for depth-testing, but only for shadows and post-processing.
Is there any way to get this to work? Without it, rendering lots of vegetation seems like a rather impossible task in Unity.
Still being worked on as it requires several steps on our part.
phil_lira and me are actively working on those. Can’t promise a release date but hopefully very soon.
I believe depth prepass is not a good deal ,but I would like to test it anyway to see if improves the fill rate (I doubt so). Is the feature now available?
Hi both, is there any update on this? Ran into this issue on Oculus Quest with a water shader using Scene Depth node for an edge-foam effect, anything rendering in front of the water has aliased shimmering white around it where the non-MSAA depth pass is added on top (I assume).
If you’re rendering a depth or depth/normals pass anyway (for postprocessing, particularly SSAO now that the URP supports it), that should be able to serve as a free prepass
But as far as I could see (only tested in the editor), the depth buffer is not preserved between the depth-normals pass and the main render pass.
Not sure if it’s possible to change this by hacking at the URP code - as it would involve dealing with color and depth buffers as separate objects (rather than a RenderTexture which contains both)