Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions src/core/renderer/tiles/TilesRendererBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,29 @@ export class TilesRendererBase {

}

/**
* Enables an optimized tile loading strategy that loads only the tiles
* needed for the current view, reducing memory usage and improving initial load times.
* Tiles are loaded independently based on screen-space error without requiring all parent
* tiles to load first. Prevents visual gaps and flashing during camera movement.
*
* Based in part on {@link https://cesium.com/learn/cesium-native/ref-doc/selection-algorithm-details.html Cesium Native tile selection}.
* @type {boolean}
* @default true
*/
get optimizedLoadStrategy() {

return this._optimizedLoadStrategy;

}

set optimizedLoadStrategy( v ) {

console.warn( 'TilesRenderer: "optimizedLoadStrategy" has been deprecated. Please toggle "loadAncestors" to adjust the tile load behavior.' );
this._optimizedLoadStrategy = v;

}

/**
* @param {string} [url] - URL of the root tileset JSON to load.
*/
Expand Down Expand Up @@ -568,21 +591,7 @@ export class TilesRendererBase {
*/
this.maxDepth = Infinity;

/**
* **Experimental.** Enables an optimized tile loading strategy that loads only the tiles
* needed for the current view, reducing memory usage and improving initial load times.
* Tiles are loaded independently based on screen-space error without requiring all parent
* tiles to load first. Prevents visual gaps and flashing during camera movement.
*
* Based in part on {@link https://cesium.com/learn/cesium-native/ref-doc/selection-algorithm-details.html Cesium Native tile selection}.
* @warn Setting is currently incompatible with plugins that split tiles and on-the-fly generate and
* dispose of child tiles including the `ImageOverlayPlugin` `enableTileSplitting` setting,
* `QuantizedMeshPlugin`, & `ImageFormatPlugin` subclasses (XYZ, TMS, etc). Any tile sets
* that share caches or queues must also use the same setting.
* @type {boolean}
* @default false
*/
this.optimizedLoadStrategy = false;
this._optimizedLoadStrategy = true;

/**
* **Experimental.** When `true`, sibling tiles are loaded together to prevent gaps during
Expand All @@ -606,7 +615,7 @@ export class TilesRendererBase {
* @type {boolean}
* @default false
*/
this.loadAncestors = false;
this.loadAncestors = true;

/**
* The number of tiles to process immediately when traversing the tile set to determine
Expand Down
45 changes: 0 additions & 45 deletions src/three/plugins/images/GeneratedSurfacePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export class GeneratedSurfacePlugin {

}

const { overlay } = this;
let res;
if ( this._useEllipsoid() ) {

Expand All @@ -105,37 +104,6 @@ export class GeneratedSurfacePlugin {

}

if ( overlay ) {

const x = tile[ TILE_X ];
const y = tile[ TILE_Y ];
const level = tile[ TILE_LEVEL ];
const range = this._tiling.getTileBounds( x, y, level, true, false );

if ( overlay.hasContent( range, level ) ) {

await overlay.lockTexture( range, level );

const texture = overlay.getTexture( range, level );
tile.overlayRange = range;
tile.overlayLevel = level;

if ( abortSignal.aborted ) {

overlay.releaseTexture( range, level );
tile.overlayRange = null;
tile.overlayLevel = null;
return null;

}

res.material.map = texture;
res.material.needsUpdate = true;

}

}

return res;

}
Expand All @@ -153,19 +121,6 @@ export class GeneratedSurfacePlugin {

}

disposeTile( tile ) {

const { overlayRange, overlayLevel } = tile;
if ( this.overlay && overlayRange ) {

this.overlay.releaseTexture( overlayRange, overlayLevel );
tile.overlayRange = null;
tile.overlayLevel = null;

}

}

/**
* Returns the cartographic coordinates for a given world-space position. "lat" and "lon" are assigned
* to the target object.
Expand Down
Loading