My application is moving the camera close to the ground in a regular motion at about an aircraft speed and altitude.
I noted some regular flashing in the rendering and could observed that the terrain tiles are constantly reloaded: even when LOD shows high level of detail, I can see the tile closest to the camera being reloaded and cycle through all the LOD levels before settling again at the previous, high, LOD. This happens constantly during the camera motion and creates all kinds of visual artifacts. Also, measurement of ground elevation at the camera location is rendered erratic since the tile keeps cycling through all different LOD levels.
Anything I missed? Anything I can do to solve this problem? Is this a bug in Cesium?
Sorry, I don’t think there’s anyway to avoid this. It’s in our long term roadmap to improve tile loading, but it may be a while before anyone has a chance to tackle it.
Thanks for the quick reply. That’s a shame because this looks like a bug that is fixable. I also believe this is seriously impacting rendering performances. I’ll stay tuned.
I feel very silly because the bug was mine. Although it uncovered a different issue.
What happened is the following. I test the terrain elevation by using globe.getHeight(). There is a certain fringe when crossing over the gap between terrain tiles where this method returns “undefined”. My code was placing the camera at altitude 0 in that case, and back to normal when over the next tile. This happened very quickly (1 frame). The camera moving down to 0 and back probably caused the LOD recycling of the tiles.
Not sure if the undefined getHeight() value can be fixed. I work around it by caching the last “good” elevation value.
Also, I definitely observed the tiles reloading through all the different LOD levels when I am pretty sure the maximum LOD was already in cache. This may be something you want to or are looking into.
Sorry for the confusion and thank you for following up.