Increase frustrum culling tolerance?

Hey everyone,

I’m developing a VR flight sim using unity and I’ve noticed that tiles are often getting culled right at the edge of my vision. Is there a way that I can increase the tolerance so that Cesium will only start culling tiles that are further away from the edge of the frustrum?

I don’t want to disable frustrum culling entirely as it’s really helping performance. I’ve found a few threads that discuss the topic, but most are for Unreal. What is there for Unity is rather outdated. I figured I would ask just in case some solution has come up in recent months.

Thanks!

Same issue here.

Hi @mtor_nav, welcome to the community!

Usually, Cesium won’t try to cull tiles that are partially in the frustum. So it sounds like there is something about the camera in VR that isn’t being correctly passed through Cesium. Do you mind sharing screenshots of the culling you’re seeing?

It would also help to have the following information:

  • What device are you running the application on? (e.g. Quest 2)
  • What does your camera setup look like? (Pasting a screenshot works)
  • What VR rendering mode are you using in your project? (For example, are you using instanced stereo rendering?)

I have suspicions of what might be the problem, but I’d like the additional information to confirm. Thank you!

Thanks! Glad to be here.

  1. We’re running our sim on a Varjo XR3. This headset does contain multiple screens, which might be part of the issue.
  2. Camera setup is as follows:

Inspector view

Hierarchy view
image

  1. Varjo settings are as follows:
    image

HI @mtor_nav, I deeply apologize for the late response.

Thank you for sharing more details! It sounds like there may be multiple factors affecting the way 3D Tiles are loaded.

In Cesium, we currently only support loading tiles from the camera tagged “Main”. The tiles are selected during Cesium3DTileset update, so if anything different is done for rendering (e.g., camera drawing twice at different angles), you may have missing tiles. This is probably exacerbated by the headset having multiple screens.

I do wonder if changing the VR Rendering mode makes a difference, but it might not. We have a Github issue for adding multiple camera support, which could potentially help in your situation. But until that feature is added, a workaround I might suggest is:

  1. Disable Enable Frustum Culling, but also,
  2. Enable Enforce Culled Screen Space Error
  3. Set Culled Screen Space Error to a high number, like 64 or higher.

Yes, this does disable frustum culling, so there may be a performance drawback. But you have control over how much detail the otherwise-culled tiles will load to. And this should hopefully massage the amount of extraneous time that it takes to load tiles.

Another workaround could be using the CesiumTileExcluder interface, and manually implementing frustum-like culling yourself. Then you can disable the built-in frustum culling, and let your logic do the culling for you. But that may be a bit more complicated to implement.

I hope these can work for you, but as always, let us know if you have any other concerns or questions!