Similar issues:
[Content removed]
[Content removed]
Hello,
We are not understanding what we are seeing when we look at dispatches in the Nanite Shading Pass on the PC. The expectation is that when a Nanite object is completely culled, it has no consideration in the raster or shading pass; Work Graph should be removing the empty dispatch. However, even with r.Nanite.MaterialVisibility=1 and shader bundling being forced on (just to be “experimentally” thorough), we are still seeing empty dispatches in the shading pass.
Here’s a breakdown:
Two Nanite objects, one occluded
[Image Removed] Nanite Base Pass - 31 dispatches
Two Nanite objects, one offscreen
[Image Removed] Nanite Base Pass - 29 dispatches
Two Nanite objects, both onscreen
[Image Removed] Nanite Base Pass - 31 dispatches
Two Nanite objects, both offscreen
[Image Removed] Nanite Base Pass - 28 dispatches
By looking at the number of dispatches in the Nanite Base Pass, we can see that even when the Nanite object is behind another one, there is an empty dispatch being generated for it. When we turn on r.ShowMaterialDrawEvents, we can see the material name of the occluded object in ShadeGbufferCS. For the purpose of this test, the aforementioned data was captured with r.ShowMaterialDrawEvents=0 in case this was negating visibility in any way.
In the actual game, we are seeing thousands of empty dispatches, many of which are likely due to this issue. On lower end GPUs, this causes an incredible amount of GPU overhead due to command processor overhead, while it is somewhat masked on higher end GPUs purely due to hardware capabilities. In Graham Whitehall’s Nanite GPU Driven Materials, there is mention of using the Work Graphs introduced in SM 6.8, however, we can’t see evidence of this (DiscardResource) actually happening in ShadeGBufferCS on any NV cards (tested on 1080, 2080, 3080, 5090):
[Image Removed]
What does Epic recommend here?
Thank you!
[Attachment Removed]