CesiumGS / cesium-unreal

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

Logic of tile loading failure #1505

Open Yeah-Zi opened 3 months ago

Yeah-Zi commented 3 months ago

I’ve observed occasional failures during the loading of TileContent, specifically at CreateOffGameThread or CreateOnGameThread. However, there is no existing logic to handle these loading failures in the code connecting Cesium for Unreal and Cesium Native. This lack of error handling can lead to incorrect tile selections during tile filtering, as tiles that haven’t successfully loaded may still be incorrectly marked as TileLoadState::Done, resulting in visible gaps in the model.

Interestingly, this issue doesn’t seem to exist in CesiumJS, which handles loading exceptions quite effectively.

Relevant Code (from TilesetContentManager.cpp):

void pWorkerRenderResources = pRenderContent->getRenderResources(); void pMainThreadRenderResources = this->_externals.pPrepareRendererResources->prepareInMainThread(tile,pWorkerRenderResources); pRenderContent->setRenderResources(pMainThreadRenderResources); tile.setState(TileLoadState::Done);

Is there any potential solution to address this issue?

kring commented 3 months ago

What sort of tile failures are you seeing? My understanding is that the code you quoted above should only be called after the tile is in the ContentLoaded state, meaning the the content has already loaded successfully.

Yeah-Zi commented 3 months ago

I have recorded some videos for us to continue discussing this issue

The phenomenon of loading errors is as follows: https://github.com/user-attachments/assets/e06fb9f3-fe3c-4c7a-8fab-322e5e6b58ff

The code for cesium native only marked warnings:

https://github.com/user-attachments/assets/8bf9563a-5e8b-444c-aaf2-24b46dc9906b

The code for cesium unreal did not address the issue of loading failure, which in my example was due to an error in the buffer view in the allocator:

https://github.com/user-attachments/assets/1c1f5243-3e9c-407d-95d6-8aac87054a0b