[cesium-dev] Cesium loads more tiles than needed?

Hi,

The important thing to understand is that terrain is that terrain and imagery are not selected independently in Cesium. Terrain tiles are selected to meet the screen-space error, and then whichever imagery tiles are attached to the terrain tile are rendered along with it. The attached imagery tiles are chosen according to this errorRatio parameter:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ImageryLayer.js#L546

(or, coincidentally, the heightmapTerrainQuality, but that is not intended behavior).

When the errorRatio is 1.0, there is approximately one imagery tile attached to each terrain tile. If it’s 0.5, there are approximately 2x2=4 imagery tiles attached to each terrain tile. 0.25 means 16 tiles. 0.1 means 100 tiles. What you really want is for high-detail imagery tiles to be rendered near the viewer and lower-detail tiles far from the viewer, even within a single terrain tile. But that is a drastically more complicated selection algorithm than the one Cesium currently uses. The assumption is that this value is going to be close to 1.0.

If you want lower quality terrain while maintaining higher quality imagery (beyond small tweaks to that errorRatio), I’m afraid your best option is to create a terrain dataset with fewer vertices in each tile.

As for your other observations, Cesium does currently load more terrain and imagery tiles than necessary, for a mix of good and not so good reasons. There’s a big chunk of working happening in the fill-tiles branch to improve this situation:

https://github.com/AnalyticalGraphicsInc/cesium/pull/7061

Some more discussion is here:

https://github.com/AnalyticalGraphicsInc/cesium/issues/3857

Kevin

I meant to link here for “more discussion” (though the one in my original email could be interesting to you as well):
https://github.com/AnalyticalGraphicsInc/cesium/issues/7042

Hi Kevin,
thank you for your exhaustive reply (and for your time).

What you really want is for high-detail imagery tiles to be rendered near the viewer and lower-detail tiles far from the viewer, even within a single terrain tile

Within the same terrain tile sounds too complex and unnecessary :slight_smile:

I think that the principle behind errorRatio, for my needs / whises, is absolutely OK, I understand why 1 / errorRatio should be an integer and I don’t see it as a limitation;
but actually I can’t change it for the reasons I already wrote about.

The near / far is another question BUT I found (about 10 minutes ago) that there is already what I’m looking for and it the screenSpaceErrorFactor property of the fog object.
I think I should adjust its value depending on camera angle with the terrain (when view direction is near parallel to terrain I need to lower value because it’s too aggressive), but definitely not a problem.

Cesium does currently load more terrain and imagery tiles than necessary, for a mix of good and not so good reasons

Ok, I don’t get into that because I’m sure I’ll oversimplify the complexities that are behind a big project like Cesium.

There’s a big chunk of working happening in the fill-tiles branch to improve this situation

Nice! I read your links, I think I’ll give a try to the fill-tiles branch.

Thank you!