Base class for 3D Tiles renderers. Manages tile loading, caching, traversal, and a plugin system for extending rendering behavior. Engine-specific renderers extend this class to add camera projection, scene management, and tile display.
On this page
- Events
- needs-update
- load-tileset
- load-root-tileset
- tiles-load-start
- tiles-load-end
- tile-download-start
- load-model
- dispose-model
- tile-visibility-change
- update-before
- update-after
- load-error
- Properties
- root
- loadProgress
- downloadQueue
- rootTileset
- fetchOptions
- visibleTiles
- activeTiles
- lruCache
- parseQueue
- processNodeQueue
- stats
- errorTarget
- errorFalloff
- errorFalloffDensity
- displayActiveTiles
- maxDepth
- loadSiblings
- loadAncestors
- maxTilesProcessed
- Methods
- constructor
- registerPlugin
- unregisterPlugin
- getPluginByName
- traverse
- getAttributions
- update
- resetFailedTiles
- dispose
- dispatchEvent
- addEventListener
- removeEventListener
Events
{ type: 'needs-update' }Fired when the renderer determines a new render is required — e.g. after a tile loads.
{
type: 'load-tileset',
// The loaded tileset object.
tileset: Tileset,
// The URL from which the tileset was loaded.
url: string
}Fired when any tileset JSON finishes loading.
{
type: 'load-root-tileset',
// The loaded root tileset object.
tileset: Tileset,
// The URL from which the tileset was loaded.
url: string
}Fired when the root tileset JSON finishes loading.
{ type: 'tiles-load-start' }Fired when tile downloads begin after a period of inactivity.
{ type: 'tiles-load-end' }Fired when all pending tile downloads and parses have completed.
{
type: 'tile-download-start',
// The tile being downloaded.
tile: Tile,
// The URL being fetched.
url: string
}Fired when a tile content download begins.
{
type: 'load-model',
// The engine-specific scene object created for this tile.
scene: Object,
// The tile the scene belongs to.
tile: Tile,
// The URL the content was loaded from.
url: string
}Fired when a tile's renderable content (model/scene) is created.
The scene type is engine-specific (e.g. THREE.Group in three.js).
{
type: 'dispose-model',
// The engine-specific scene object being disposed.
scene: Object,
// The tile the scene belonged to.
tile: Tile
}Fired when a tile's renderable content is about to be removed and destroyed.
The scene type is engine-specific (e.g. THREE.Group in three.js).
{
type: 'tile-visibility-change',
// The engine-specific scene object.
scene: Object,
// The tile whose visibility changed.
tile: Tile,
// Whether the tile is now visible.
visible: boolean
}Fired when a tile transitions between visible and hidden.
The scene type is engine-specific (e.g. THREE.Group in three.js).
{ type: 'update-before' }Fired at the start of each update() call, before traversal begins.
{ type: 'update-after' }Fired at the end of each update() call, after traversal completes.
{
type: 'load-error',
// The tile that failed, or null if a root tileset failed.
tile: Tile | null,
// The error that occurred.
error: Error,
// The URL that failed to load.
url: string | URL
}Fired when a tile or tileset fails to load.
Properties
Root tile of the loaded root tileset, or null if not yet loaded.
Fraction of tiles loaded since the last idle state, from 0 (nothing loaded) to 1 (all loaded).
Download queue managing concurrent tile downloads per server origin. Max jobs per origin
defaults to 25.
The loaded root tileset object, or null if not yet loaded.
fetchOptions: RequestInit = {}
Options passed to fetch when loading tile and tileset resources.
Set of all tiles that are currently visible.
Set of all tiles that are currently active (displayed as a stand-in while children load).
LRU cache managing loaded tile lifecycle and memory eviction.
Priority queue controlling concurrent tile parsing. Max jobs defaults to 5.
Priority queue for expanding and initializing tiles for traversal. Max jobs defaults to 25.
stats: Object
Loading and rendering statistics updated each frame. Fields:
inCache— tiles currently in the LRU cachequeued— tiles queued for downloaddownloading— tiles currently downloadingparsing— tiles currently being parsedloaded— tiles that have finished loadingfailed— tiles that failed to loadinFrustum— tiles inside the camera frustum after the last updateused— tiles visited during the last traversalactive— tiles currently set as activevisible— tiles currently visiblerefused— tiles the last update wanted to load but could not queue because the cache was full
errorTarget: number = 16
Target screen-space error in pixels to aim for when updating the geometry. Tiles will not render if they are below this level of screen-space error. See the geometric error section of the 3D Tiles specification for more information.
errorFalloff: number = 0
Maximum screen-space error in pixels subtracted from distant tiles. Set to 0 to disable. Comparable to Cesium's "dynamicScreenSpaceError" settings.
error -= errorFalloff * ( 1 - e ^ -( distance * errorFalloffDensity )² )
[!WARN] Experimental and may change.
errorFalloffDensity: number = 2e-4
Distance scale for the "errorFalloff" curve, in inverse meters. Larger values affect tiles closer to the camera. Comparable to Cesium's "dynamicScreenSpaceError" settings.
[!WARN] Experimental and may change.
displayActiveTiles: boolean = false
"Active tiles" are those that are loaded and available but not necessarily visible.
These tiles are useful for raycasting off-camera or for casting shadows. Active tiles
not currently in a camera frustum are removed from the scene as an optimization.
Setting this to true keeps them in the scene so they can be rendered from an outside
camera view not accounted for by the tiles renderer.
maxDepth: number = Infinity
Maximum depth in the tile hierarchy to traverse. Tiles deeper than this are skipped.
loadSiblings: boolean = true
Experimental. When true, sibling tiles are loaded together to prevent gaps during
camera movement. When false, only visible tiles are loaded, minimizing memory but
potentially causing brief gaps during rapid movement. Implicitly treated as true when
loadAncestors is enabled.
loadAncestors: boolean = true
Experimental. When true, ancestor tiles are queued for download and displayed as a
fallback while children are loading — similar to the behavior of the standard load
strategy. Increases memory usage but provides smoother transitions on first load.
Implicitly enables sibling loading to prevent flickering during camera movement.
maxTilesProcessed: number = 250
The number of tiles to process immediately when traversing the tile set to determine what to render. Lower numbers prevent frame hiccups caused by processing too many tiles at once when a new tile set is available, while higher values process more tiles immediately so data can be downloaded and displayed sooner.
Methods
new TilesRendererBase(
// URL of the root tileset JSON to load.
url: string = null
)registerPlugin( plugin: Object ): voidRegisters a plugin with this renderer. Plugins are inserted in priority order and receive lifecycle callbacks throughout the tile loading and rendering process. A plugin instance may only be registered to one renderer at a time.
unregisterPlugin( plugin: Object | string ): booleanRemoves a registered plugin. Calls plugin.dispose() if defined.
Accepts either the plugin instance or its string name.
Returns true if the plugin was found and removed.
getPluginByName( name: string ): Object | nullReturns the first registered plugin whose name property matches, or null.
traverse(
beforecb?: ( tile: Tile, parent: Tile | null, depth: number ) => boolean | null,
aftercb?: ( tile: Tile, parent: Tile | null, depth: number ) => void | null
): voidIterates over all tiles in the loaded hierarchy. beforecb is called before
descending into a tile's children; returning true from it skips the subtree.
aftercb is called after all children have been visited.
getAttributions(
target?: Array<{type: string, value: any}>
): Array<{type: string, value: any}>Collects attribution data from all registered plugins into target and returns it.
update(): voidRuns the tile traversal and update loop. Should be called once per frame after camera matrices have been updated. Triggers tile loading, visibility updates, and LRU cache eviction.
resetFailedTiles(): voidResets any tiles that previously failed to load so they will be retried on the next update.
dispose(): voidDisposes all loaded tiles and unregisters all plugins. The renderer should not be used after calling this.
dispatchEvent( e: Object ): voidDispatches an event to all registered listeners for the given event type.
addEventListener(
name: string,
callback: ( event: Object ) => void
): voidRegisters a listener for the given event type.
removeEventListener(
name: string,
callback: ( event: Object ) => void
): voidRemoves a previously registered event listener.