CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
879 stars 285 forks source link

Occlusion culling is stuck on waiting for results? #1429

Closed KieranCoppins closed 1 month ago

KieranCoppins commented 1 month ago

Hi there,

I decided to look into occlusion culling to help performance in my application as mentioned in this blog article but I am having some issues with it. Having occlusion culling enabled on my 3d tileset causes no tiles to load. It appears to be stuck waiting for the occlusion results as the latest entry in my output log shows:

LogCesium: Display: Cesium3DTileset_0: 156 ms, Visited 2, Culled Visited 0, Rendered 1, Culled 0, Occluded 0, Waiting For Occlusion Results 1, Max Depth Visited: 1, Loading-Worker 0, Loading-Main 0, Loaded tiles 0%

I have enabled the Enable Experimental Occlusion Culling Feature in the plugin settings inside the project settings and if I disable occlusion culling on the 3D tile, it renders all my tiles (without culling of course).

I have done some investigation into what might be causing this and have looked at some unreal engine visualizations. I have disabled occlusion culling to render the tiles for these screenshots:

image Bounds appear to be set correctly for the google 3d tiles

image I have a platform with some normal actors and have enabled r.VisualizeOccludedPrimitives 1 in the console to see that normal occlusion culling appears to work

image Interestingly it appears that the depth buffer has this staggered effect from the camera, I am visualizing this by Buffer Visualisation -> Scene Depth. I would assume that this is not correct and could be the cause of my occlusion culling to not work?

image Here is a screenshot of my 3d tile settings incase this might have caused some issues, however a lot of them are defaults.

Some more information on my versions:

Thanks for any help with this and let me know if you'd like any more details!

kring commented 1 month ago

Thanks for the detailed report @KieranCoppins. I just opened a PR to fix this (linked above).