Early Z pass performance breakthrough?

Enabling Early Z pass on Masked materials in render settings is giving me a huge boost in a scene with tons of foliage. However, it is unable to render 2d sprites in some areas while causing jagged shadows of characters in one area. I initially thought that the jagged shadows were being caused because of something else. Turning Early Z pass off or setting it to automatic fixes the shadow issue but brings back the overdraw and shader complexity.
My questions:
>I have been reading up on early Z pass for a while now and it seems like a breakthrough for making alpha-heavy scenes. Why doesn’t UE4 have it enabled on masked materials to begin with?
>What else did I miss while reading up on it?
>Has anyone encountered the ‘bad rendering’ issue of 2D sprites with enabled Z pass?

If anyone has any content regarding this matter, please let me know.
All help is appreciated.

It’s not enabled by default because there is a trade-off. Yes, it improves overdraw in the pixel pass, but it moves some of that cost to the pre-pass, which in some cases may not really exist or barely cost anything. The effectiveness is also dependent on triangle count vs overdraw, I believe. If you keep your foliage cut around the alpha mask, but with a lower amount of triangles, computing the alpha in the depth pass will be cheaper. But the depth pass is dependent on triangles, so if you’re the type to go in and cut around every little curve in your alpha, then you won’t see much of a benefit because of the added triangle amount.

I’ve never noticed any issues with shadows or 2D sprites, but I haven’t done anything with sprites before. Maybe someone else can chime in

3 Likes

Thank you for the Swift response :slight_smile:

I will look into it!

try enabling “Output velocities during base pass” (must use TAA).

Any nes on this? I am having similar issues with my Nanite foliage and tried all of this.

@TheSubZer0 @anonymous_user_cbebb28b @rosegoldslugs