Clustered Deferred Shading relies on Nanite Project Enabled cvar

Hello,

Recently we’ve enabled Clustered Deferred Shading for our project, after doing A/B Test it gave us some performance improvement. Though in our project we don’t use Nanite, so we have r.Nanite=0. Then we found out, that Nanite still creates Streaming Pool, which we could decrease to zero, but we tried to use r.Nanite.ProjectEnabled=0 and Clustered Deferred stopped working.

While we were looking for an issue behind that, it seems that:

ShouldUseClusteredDeferredShading checks DoesPlatformSupportVirtualShadowMaps

DoesPlatformSupportVirtualShadowMaps checks DoesPlatformSupportNanite

DoesPlatformSupportNanite checks if Nanite is Project Enabled.

As result, Clustered Deferred Shading cannot work without Nanite Project Enabled, nor VSM. To me that makes no sense: DoesPlatformSupport should mean if platform is capable to use that feature, e.g. needed Shader Model, Feature level, directx vs opengles etc.

DoesPlatformSupportNanite also has bool bCheckForProjectSetting as argument, which has been never used in function code.

I think this should be fixed: either bCheckForProjectSetting properly used, or DoesPlatformSupportNanite shall not check the Nanite Project Enabled cvar.

Please check the referenced question: [Cannot use Virtual Shadow Maps in non-Nanite [Content removed]

p.s. We don’t use Nanite since we would not benefit from it too much - game is mostly top-down so player either sees LOD0, or no object at all. We don’t use VSM either, because of the moving sun/moon.

[Attachment Removed]

Steps to Reproduce

  1. Enable Clustered Deferred Shading with r.UseClusteredDeferredShading_ToBeRemoved = 1
  2. Disable Nanite in Project with r.Nanite.ProjectEnabled = 0
  3. Observe Clustered Deferred Shading does not work (as well VSM does not)
    [Attachment Removed]

Hi,

thanks for reporting this. For clustered deferred shading, it’s important to know that this feature will no longer be supported in future engine releases as mentioned in this commit.

Before I can file a bug report, could you please provide a bit more detail on how you determine that clustered deferred shading doesn’t work? Are you using the GPU Profiler for this or some other tool?

Thanks,

Sam

[Attachment Removed]

Thanks for the update. I have filed a bug report and will update the ticket when it becomes available on the public issue tracker.

Best regards,

Sam

[Attachment Removed]

Hello,

Yes, we know about the deprecation of this feature.

We were able to find this behavior based on some performance have been lost after disabled Nanite for the Project (r.Nanite.ProjectEnabled = 0). To understand why is it happening we checked the code, and found the FDeferredShadingSceneRenderer::RenderLights function, which does not call AddClusteredDeferredShadingPass because of ShouldUseClusteredDeferredShading returns false when Nanite is project-disabled.

As a side note, VSM also relies on the Nanite Project Enabled flag, but those two technologies, despite working better together, shall not rely on each other availability imo.

Best regards,

Bohdan

[Attachment Removed]

Hi,

this is now available on the public issue tracker at this link, so you can track its progress. Your feedback w.r.t. VSM relying on Nanite has also been passed onto Epic’s internal tracker.

Thanks again,

Sam

[Attachment Removed]

Hi Sam,

Appreciate your help! Waiting for fixes

Best regards,

Bohdan

[Attachment Removed]

No problem! I will close this case for now, but feel free to re-open it if you have more questions.

Thanks again,

Sam

[Attachment Removed]