Jump to content

Depth pre-pass and alpha test


photo

Recommended Posts

Hi,

Just wondering why depth pre pass is forced on alpha test surfaces? I mean, I understand why, from performance pov, you may want this for complex materials (with multiple layers or complex shaders) but why on alpha test surfaces?

Asking this since in many of our scenes the bottleneck is actually on the rendering calls count, and while depth pre pass is disabled, we still have like double the calls for alpha test surfaces. Following the general wisdom, we "forced" transparent as 1 on many of our materials so we cut down their number (in general a simple alpha test is not that heavy on the fragment) but now we have to do two variants (alpha test and non alpha tests) just to cut on rendering calls.

Regards,

Adrian L.

Link to comment

Hi Adrian,

Rendering objects into the depth buffer is relatively cheap operation and highly optimized on the GPUs. In the most cases disabling depth pre-pass for the alpha test materials will result in significant performance drop (I'm talking about fillrate issues when rendering vast vegetation like grass or trees).

You can modify engine sources and disable depth pre-pass in your case to see if it reduce the CPU workload. But in that case you can get the same GPU workload increase, so it may either to kill your performance even more (if you have quite weak GPU) or slightly increase the framerate.

I think the same framerate gain you may achieve by properly set up LODs the objects or adjusting the rendering distance. If you can also send us two microprofile dumps (from the default engine version and patched with disabled depth pre-pass) - it would be interesting to see the changes.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi and thank you for the fast support!

Our case is very particular. We have many many solid surfaces (buildings) but most (or at least a big part of them) don't overlap (bigger and bigger buildings are still seen in the distance). And they have simple shaders. So our bottleneck is in the rendering calls count (we are working on improving that on other fronts as well). 

Your default usage, now that you mentioned vegetation (since you have foliage on top of foliage on top of foliage etc), makes sense (even though an option to completely disable depth pre pass would be nice). 

For now, please don't bother with our case. I manage to reduce the rendering calls quite a lot by using a special alpha test material only when I do need it (we have a hint flag in our custom meshes). So depth pre pass is happening only to around 20% of our total meshes. LOD is already applied quite aggressively. We are also using mesh clusters. But we have quite few unique textures (so we are working on texture atlasing).

Kind Regards,
Adrian L.

  • Thanks 1
Link to comment
×
×
  • Create New...