SceneCapture Disabling Occlusion

Hello!

I’m attempting to disable as many unnecessary features of the scene capture component to make it as cheap as possible on the GPU and render thread. The scene capture is just used to render a single animating skel mesh with a few shadow casting lights. Nothing that’s passed in to the scene capture’s ShownComponents needs to go through any kind of culling. I was able to turn on the “DisableOcclusionQueries” show flag for the scene capture but it still does a RenderHzb pass that it doesn’t seem to use. In the code I’ve noticed it doesn’t seem to check the bIsOcclusionTesting flag before doing this pass. I’ve locally added the code to check the flag and not call RenderHzb in that case, which works with no noticeable changes, but I’m not sure if this is going to have some unseen negative effect. Does this look like a safe change?

  ...
  const bool bUseHzbOcclusion = bIsOcclusionTesting ? RenderHzb(GraphBuilder, SceneTextures.Depth.Resolve, BuildHZBAsyncComputeParams, FroxelRenderer) : false;
  ...

[Attachment Removed]

Hi there,

Thanks for your information.

For the use case you described, this looks reasonable and low risk. One thing to keep in mind is that the HZB is used for more than just classic occlusion queries. That’s why RenderHzb isn’t gated on bIsOcclusionTesting.

If your SceneCapture doesn’t rely on any screen-space effects and isn’t feeding into systems like Lumen, VSMs, distance field AO, or similar features, then skipping RenderHzb is very unlikely to cause any negative side effects.

Hope this helps. Let me know if you have any further questions.

Best regards,

Henry Liu

[Attachment Removed]

Great thanks so much!

[Attachment Removed]

You are very welcome.

I will close this case now, but feel free to respond here if you have any follow-up questions.

Cheers,

[Attachment Removed]