I'm working on quadtree primitives which will load & render tiles in specific levels. To achieve this goal I have to tweak the implementation of QuadtreePrimitive. I have some questions about the implementation and would like to check if there's something wrong with my understanding.
Observation: It seems a tile will not be refined until it has been loaded & renderable, meanwhile the parent tile will loaded & render. To some extent it's a reasonable strategy since user can see still see something before everything is loaded. However, it may bring some problems.
1. In my use case where users focus on level 14-15 in the beginning, the strategy triggers too many network requests. The first sight of the globe with terrain may involve 750+ requests and transfer 14mb+ data. The data volume may not be a huge problem, but the request number is far too higher than necessary. Any extra calculation more than serving a cached image on the server side may cause a big performance problem.
2. Though a tile can be loaded asynchronously with its direct parent tile, its loading will be strictly after its grandparent, which, in my case, means the loading of most important tiles will be 5-6 times slower.
3. The function "markTileRendered" is in turn called too much. 100 as the default tile cache size can be easily excelled in a higher level. The tiles in view (though the amount is far less than 100) may be frequently flushed out of the cache and have to reload. Yes we can increase the tile cache size but it's not the best solution I think.
My thoughts & choice:
Instead of change the logic of QuadtreePrimitive too much, I'd like to reside most of the specific logic in my tileProvider. I set upsampledFromParent to prevent more refinement beyond certain level. Meanwhile, I try to turn off renderable to prevent tiles above certain level to render, where I hit the bottleneck, since QuadtreePrimitive refuses to refine then. Currently I copied the code from QuadtreePrimitive, removed the allChildrenRendered check, and did some extra tweaks to reduce the cache usage. However, it breaks the goodness to show low quality tiles while detailed tiles are loading.
I think the key idea is to allow some non-renderable or needless-to-cache tiles to refine. Looking forward to further discussion so I can continue trying to make my current work compatible with original strategy (and hopefully submit a PR finally)
All the best