While using Cesium for Unity, I noticed a behavior that I would like to better understand. I’m wondering whether this is an intentional design choice or if there are recommended optimization approaches.
Scenario
The behavior occurs in both of the following situations.
Case 1: Zooming Out Quickly (Low Level → High Level)
- The camera starts at a detailed level (e.g., Zoom Level 15), triggering many high-resolution tile requests.
- Before those requests complete, the camera quickly zooms out to a much higher level (e.g., Zoom Level 5).
- The previously requested detailed tiles are no longer needed for rendering.
- However, the requests continue downloading until completion.
Case 2: Zooming In Quickly (High Level → Low Level)
- The camera starts at a coarse level (e.g., Zoom Level 5).
- The camera quickly zooms in to a detailed level (e.g., Zoom Level 15).
- The previously requested low-resolution tiles are no longer the optimal representation for the current view.
- Those requests also continue until completion.
Based on network captures and logs, once a request has been issued, it appears to continue downloading even if the corresponding tile is no longer needed by the current view.
Questions
- Is it the default behavior in Cesium Native / Cesium for Unity that issued tile requests are not cancelled?
- When a tile is later determined to be unnecessary during tile selection, is it simply excluded from rendering while the network request continues?
- Once a request has entered the IAssetAccessor or UnityWebRequest stage, does Cesium provide any cancellation mechanism?
- Is this design primarily motivated by:
- Better cache reuse?
- Avoiding the overhead of cancelling and recreating connections?
- Simpler request scheduling?
- Other architectural considerations?
- For scenarios involving rapid zooming or camera flights, are there recommended ways to reduce requests that ultimately will never be used?
My Current Understanding (Possibly Incorrect)
After reading some of the source code, my impression is that tile selection and asset requests have relatively independent lifecycles.
When a tile is no longer required:
- The tile’s state may be updated;
- It is no longer selected for rendering;
- However, any network request already submitted to the AssetAccessor continues running;
- The result may later be cached or discarded after completion.
I’m not sure whether this interpretation is accurate, so I would appreciate any clarification from people familiar with Cesium Native’s implementation.
Thanks in advance.