CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.66k stars 3.43k forks source link

Unnecessary tile requests #6519

Closed puckey closed 6 years ago

puckey commented 6 years ago

While working on http://radio.garden, I noticed many extra tile requests occurring after the necessary tiles have been loaded. As far as I can see, these requests are for tiles which are no longer visible in my view.

I tracked this down to the low priority queue (this._tileLoadQueueLow) in https://github.com/AnalyticalGraphicsInc/cesium/blob/ea7dfbcb163d92356394faa51d7a1a132a1ad06b/Source/Scene/QuadtreePrimitive.js:

This queue is described as low priority tiles were refined past or are non-visible parts of quads.. This description makes me wonder why this queue is really necessary.

The comments in the following code hint at the tiles being necessary, but when I comment out the code, it saves approx 30% on tile imagery requests with no noticeable downsides..

// We've decided this tile is not visible, but if it's not fully loaded yet, we've made
// this determination based on possibly-incorrect information.  We need to load this
// culled tile with low priority just in case it turns out to be visible after all.
if (tile.needsLoading) {
    primitive._tileLoadQueueLow.push(tile);
}

My tiles are hosted on an ArcGis map server. I am using the ArcGisMapServerImageryProvider.js to display them...

kring commented 6 years ago

@puckey there are lots of details about this issue here: https://github.com/AnalyticalGraphicsInc/cesium/pull/4969

Short version: not loading these low-priority tiles will cause tiles to be missing entirely in some scenes, and we can't (currently) determine ahead of time when this will be an issue.

The good news is that there is work underway to address this. Specifically, we're extending the terrain server to make bounding volume hierarchy information available without downloading individual tiles, and teaching Cesium to use that information to much more directly load the exact tiles that it needs to render.

puckey commented 6 years ago

Thanks for pointing me to the related issue!

Seeing as I am not doing anything with 3d terrain tiles and haven't noticed any render errors without it (yet), I am going to comment out this code on my side for the time being.