To achieve dynamic switching of raster layers, we call the Activate/Deactivate CesiumRasterOverlay layer function at runtime to show or hide specified layers in real-time. This feature worked perfectly in version v1.23. However, after we recently upgraded the Cesium for Unreal version to the latest (v2.5.0), we found that when switching the raster layers while moving the camera, some tiles fail to be properly removed during the rendering frame, causing them to overlap with newly loaded tiles.
Upon a preliminary examination of the source code, we discovered that in Cesium3DTileset.cpp, the calls to this->_pTileset->updateView and pResult->tilesToRenderThisFrame during the Tick are interfered by the dynamic switching of layers. Tracing to Tileset.cpp, the following code where traversalDetails.allAreRenderable=false when dynamically enabling/disabling layers, which kicks all child nodes, resulting in pResult->tilesToRenderThisFrame.size()=1. This causes confusion in the hideTiles() function during the Tick in Cesium3DTileset.cpp.
Although we have roughly identified the cause, we are unsure how to fix this issue, so we would appreciate your help in reviewing it. Thank you very much.
(Please see the attached video for the bug test recording.)
To achieve dynamic switching of raster layers, we call the Activate/Deactivate CesiumRasterOverlay layer function at runtime to show or hide specified layers in real-time. This feature worked perfectly in version v1.23. However, after we recently upgraded the Cesium for Unreal version to the latest (v2.5.0), we found that when switching the raster layers while moving the camera, some tiles fail to be properly removed during the rendering frame, causing them to overlap with newly loaded tiles.
https://github.com/CesiumGS/cesium-unreal/assets/57782609/59a8af15-6b18-4c95-9f74-add39f4125eb
The test level blueprint is shown below:
Upon a preliminary examination of the source code, we discovered that in Cesium3DTileset.cpp, the calls to this->_pTileset->updateView and pResult->tilesToRenderThisFrame during the Tick are interfered by the dynamic switching of layers. Tracing to Tileset.cpp, the following code where traversalDetails.allAreRenderable=false when dynamically enabling/disabling layers, which kicks all child nodes, resulting in pResult->tilesToRenderThisFrame.size()=1. This causes confusion in the hideTiles() function during the Tick in Cesium3DTileset.cpp.
Although we have roughly identified the cause, we are unsure how to fix this issue, so we would appreciate your help in reviewing it. Thank you very much. (Please see the attached video for the bug test recording.)