Open gkjohnson opened 1 month ago
Cesium's implementation updates all child frustum and error metrics before marking children as "used":
It's also the case that Cesium does not unload external tile sets: https://github.com/CesiumGS/cesium/blob/165e0fb4fcc9a448b15de6a2df46db23c71fffda/packages/engine/Source/Scene/Cesium3DTile.js#L1423-L1425
In a test the frustum optimization improves the tile visibility from 350 to 323 so it can have quite an impact. With a more shallow approach this loads ~340 tiles on google earth tiles.
The limited approach may be "good" enough - otherwise this requires keeping all tile sub trees in memory.
It's possible we could keep the tile marked as "used" but mark "in frustum" to be false and account for that in the subsequent traversals. This would cause the tiles to still load but at least not be rendered.
In d316413 the check for child visibility has been disabled because it can cause unused children to be added to the lru cache. We should understand why and see if we can add an easy way to check frustum visibility without marking a child as used.
The fundamental issue is that external tile sets are being marked as unused because the children aren't visible, being unloaded, then being marked as used again because there are no children and loading.
Related to #740