3DTilesRendererJS
3DTilesRendererJS copied to clipboard
Provide example demonstrating how to use two TileRenderers sharing a cache and queues
Make two tile renderers for two tilesets that share the LRUCache, download, and parse queues.
// Using the automatically instantiated priority queues and cache ensures
// we have the default priority callbacks set by the renderer.
const tilesRenderer1 = new TilesRenderer( url1 );
const {
lruCache,
downloadQueue,
parseQueue
} = tilesRenderer1;
const tilesRenderer2 = new TilesRenderer( url2 );
tilesRenderer2.lruCache = lruCache;
tilesRenderer2.downloadQueue = downloadQueue;
tilesRenderer2.parseQueue= parseQueue;
// ...
function render() {
tilesRenderer1.update();
tilesRenderer2.update();
renderer.render( scene, camera );
}
Tested this with two of the same tilesets to verify it worked and added setup instructions in 049848b.
This should have new example data for a proper demo.
The mars demo could implement this.
Related to #376 - if we share a download cache the sky tiles will inevitably download first because they are shallow and the sort approach ensures they download first.