Skip to main content

Tiles module · 3D runtime

Tileset3D

The shared runtime for hierarchical 3D data: traverse visible tiles, cull by volume, schedule requests, manage cache state, and coordinate selected content.

View-dependent delivery

A hierarchy turns one scene into useful requests.

Tiled formats keep spatial structure and level-of-detail metadata alongside their payloads. A runtime can select visible leaves instead of downloading the complete world.

Dataset hierarchy

root · world boundscoarse content and children
region westgeometric error
region eastgeometric error
leaf · L06leaf · L07leaf · L06leaf · L08

Current view

viewport + error budget
boundsSSEpriority
selected contentFetch only the leaves that can contribute to this view.
glTFpointstextures
Tileset3D traversal ↗

3D Tiles and I3S differ in their resource layouts, but the application-facing idea is the same: preserve the hierarchy, select by view, and request content progressively.

The 3D runtime

Select the data the view needs, when it needs it.

Tileset3D keeps hierarchical data responsive by combining view-dependent traversal with source-provided metadata and content loading.

Traversal

Choose tiles by screen-space and hierarchy

Culling

Test volumes against the current view

Requests

Schedule and prioritize tile content

Cache

Retain, unload, and refresh tile state

Detailed guide

Tileset3D reference

The sections below document construction, viewport updates, callbacks, traversal, cache behavior, and source integration.

The Tileset3D class is the shared runtime for traversal, culling, selection, cache management, and request scheduling across source-backed 3D tilesets.

For deterministic traversal snapshots and request/cache diagnostics, see Runtime observability and benchmark baselines.

It is constructed with a Tileset3DSource, such as Tiles3DSource or I3SSource.

Standards​

Usage​

Loading a tileset and instantiating a Tileset3D instance.

import {Tiles3DLoader} from '@loaders.gl/tiles-3d/3d-tiles';
import {Tiles3DSource} from '@loaders.gl/tiles-3d/3d-tiles';
import {Tileset3D} from '@loaders.gl/tiles-3d/tileset';

const tilesetUrl = 'https://assets.ion.cesium.com/43978/tileset.json';
const source = new Tiles3DSource({url: tilesetUrl, loader: Tiles3DLoader});
const tileset = new Tileset3D(source, {
onTileLoad: (tile) => console.log(tile)
});

Loading a tileset from an I3S source and updating it with the viewport:

import {I3SLoader} from '@loaders.gl/tiles-3d/i3s';
import {I3SSource} from '@loaders.gl/tiles-3d/i3s';
import {Tileset3D} from '@loaders.gl/tiles-3d/tileset';
import {WebMercatorViewport} from '@deck.gl/web-mercator';

const tilesetUrl =
'https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/SanFrancisco_Bldgs/SceneServer/layers/0';
const source = new I3SSource({url: tilesetUrl, loader: I3SLoader});
const tileset = new Tileset3D(source, {
onTileLoad: (tile) => console.log(tile)
});

const viewport = new WebMercatorViewport({latitude, longitude, zoom});
await tileset.selectTiles(viewport);
const visibleTiles = tileset.tiles.filter(tile => tile.selected);

Tileset3D.selectTiles waits for initialization and coalesces viewport updates. Call it again when the viewport changes; the selected set can continue to change as requested tile content arrives.

Tileset3D.update(viewport) remains available as a fire-and-forget compatibility wrapper when the application does not need to await the traversal promise.

Traversal also needs a zero-pitch copy of the viewport to measure the projected size of I3S tiles. By default it calls the viewport constructor with longitude, latitude, zoom, bearing, position, width, height and pitch: 0. A viewport that cannot be rebuilt from these options, such as a viewport in a projected CRS, can supply getTopDownViewport(), which returns the same camera with zero pitch in the same projection. When the viewport has no longitude and latitude, maximumTilesSelected measures tile distances from the unprojected viewport center.

Constructor​

new Tileset3D(source, {
onTileLoad: (tile) => console.log(tile)
});

Parameters:

  • source: a Tileset3DSource instance
  • options:
    • options.ellipsoid=Ellipsoid.WGS84 (Ellipsoid) - The ellipsoid determining the size and shape of the globe.
    • options.throttleRequests=true (Boolean) - Determines whether or not to throttle tile fetching requests. Throttled requests are prioritized according to tile visibility.
    • options.maxRequests=64 (Number) - When throttling tile fetching, the maximum number of simultaneous requests.
    • options.modelMatrix=Matrix4.IDENTITY (Matrix4) - A 4x4 transformation matrix this transforms the entire tileset.
    • options.cacheBytes=536870912 (Number) - Soft target in bytes for estimated cached 3D Tiles content. Current-frame tiles remain protected. I3S retains a 33554432 default. See Caching and memory.
    • options.maximumCacheOverflowBytes=536870912 (Number) - Additional current-frame headroom in bytes before cache pressure raises the active SSE threshold. I3S retains a 1048576 default.
    • options.memoryAdjustedScreenSpaceError=true (Boolean) - Adapts the active SSE threshold when estimated usage exceeds cacheBytes + maximumCacheOverflowBytes. I3S retains its false default.
    • options.viewDistanceScale=1.0 (Number) - Multiplies calculated screen-space error. Lower values stop refinement earlier; higher values select more detail. See Screen-space error and level of detail.
    • options.progressiveResolutionHeightFraction=0.3 (Number) - Prioritizes coarse viewport coverage using SSE at a reduced logical viewport height. Set to 0 to disable; values above 0.5 are ignored. See Request scheduling and priorities.
    • options.foveatedScreenSpaceError=true (Boolean) - Prioritizes perspective requests near the camera view axis before peripheral detail. This changes request timing, not the final LOD target. See Request scheduling and priorities.
    • options.foveatedConeSize=0.1 (Number) - Fraction of the perspective field of view that receives no foveated SSE relaxation. Set to 1 to disable peripheral deferral.
    • options.foveatedMinimumScreenSpaceErrorRelaxation=0 (Number) - Minimum logical-pixel SSE relaxation immediately outside the center cone.
    • options.foveatedInterpolationCallback=linear interpolation (Function) - Interpolates logical-pixel SSE relaxation from the cone edge toward the viewport edge.
    • options.foveatedTimeDelay=0.2 (Number) - Maximum seconds eligible peripheral requests wait after camera movement. Traditional REPLACE traversal is never deferred.
    • options.updateTransforms=true (Boolean) - Always check if the tileset modelMatrix was updated. Set to false to improve performance when the tileset remains stationary in the scene.
    • options.loadOptions - loaders.gl options used when loading tiles from the tiling server. Includes fetch options such as authentication headers, worker options such as maxConcurrency, and options to other loaders such as 3d-tiles, gltf, and draco.
    • options.contentLoader = null (Promise) - An optional external async content loader for the tile. Once the promise resolves, a tile is regarded as READY to be displayed on the viewport.
    • options.loadTiles=true (Boolean) - Whether the tileset traverses and updates tiles. Set this option to false at runtime to freeze the scene.

Callbacks:

  • onTileLoad ((tileHeader : Tile3D) : void) - callback when a tile node is fully loaded during the tileset traversal.
  • onTileUnload ((tileHeader : Tile3D) : void) - callback when a tile node is unloaded during the tileset traversal.
  • onTileError ((tileHeader : Tile3D, message : String) : void) - callback when a tile fails to load during traversal.
  • onTraversalComplete ((selectedTiles : Tile3D[]) : Tile3D[]) - callback post-process selectedTiles right after traversal.

The Tileset3D allows callbacks (onTileLoad, onTileUnload) to be registered that notify the app when the set of tiles available for rendering has changed. Tile loads complete asynchronously, so the selected set can change after a traversal call returns.

For format-specific source behavior, see:

Cesium 3D tiles specific options:

  • options.maximumScreenSpaceError=8 (Number) - The maximum screen-space error used to drive level-of-detail refinement. See Screen-space error and level of detail.
  • options.dynamicScreenSpaceError=true (Boolean) - Reduces refinement for distant, horizon-facing tiles in perspective views. Orthographic traversal is unaffected.
  • options.dynamicScreenSpaceErrorDensity=0.0002 (Number) - Base fog density, in inverse meters, used by dynamic SSE. Higher values reduce distant refinement sooner.
  • options.dynamicScreenSpaceErrorFactor=24 (Number) - Maximum dynamic SSE reduction in logical/CSS pixels.
  • options.dynamicScreenSpaceErrorHeightFalloff=0.25 (Number) - Fraction of the root tileset height at which dynamic SSE starts to fade as the camera rises. Values are clamped to [0, 1].

See Screen-space error and level of detail for the formulas, worked example, projection boundaries, and tuning guidance.

Properties​

boundingVolume (BoundingVolume)​

The root tile's bounding volume, which is also the bounding volume of the entire tileset. See Tile3D#boundingVolume.

cartesianCenter (Number[3])​

Center of tileset in fixed frame coordinates.

cartographicCenter (Number[3])​

Center of the tileset in cartographic coordinates [long, lat, elevation].

When centering a standalone deck.gl view on an elevated geospatial tileset, use its elevation for the camera target as well as its longitude and latitude, for example position: [0, 0, tileset.cartographicCenter[2]]. Preserve any explicit application camera placement. This center is a viewing target, not necessarily ground height. See Camera elevation and high-altitude content for terrain-aware navigation and host-map integration.

ellipsoid (Ellipsoid)​

Gets an ellipsoid describing the shape of the globe.

modelMatrix (Matrix4)​

A Matrix4 instance (4x4 transformation matrix) that transforms the entire tileset.

This includes region bounding volumes used for tile culling, content culling, and viewer requests. Regions ignore the tile transforms stored in the tileset JSON, as required by 3D Tiles, but respond to application transforms applied through modelMatrix. Updating modelMatrix updates these bounds during traversal when updateTransforms is enabled (the default). The tile's cartographic boundingBox is also recomputed from the transformed volume; untransformed regions retain their exact geographic bounds from the source JSON.

root (Tile3D)​

The root tile header.

tiles (Tile3D[])​

All the tiles that have been traversed.

stats (Stats)​

An instance of a probe.gl Stats object that contains information on how many tiles have been loaded etc. Easy to display using a probe.gl StatsWidget.

tileset (Object)​

The original tileset data this object instanced from.

tilesLoaded (Boolean)​

When true, all tiles that meet the screen space error this frame are loaded. The tileset is completely loaded for this view.

gpuMemoryUsageInBytes (Number)​

The total amount of GPU memory in bytes used by the tileset. This value is estimated from geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also includes per-point metadata.

url (String)​

The url to a tileset JSON file.

zoom (Number[3])​

A web mercator zoom level that displays the entire tile set bounding volume

tilesLoaded : boolean​

When true, all tiles that meet the screen space error this frame are loaded. The tileset is completely loaded for this view.

See Tileset3D#allTilesLoaded

Cesium 3D Tiles properties​

asset : Object​

Gets the tileset's asset object property, which contains metadata about the tileset.

See the asset schema reference in the 3D Tiles spec for the full set of properties.

properties : Object​

Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.

See the properties schema reference in the 3D Tiles spec for the full set of properties.

maximumScreenSpaceError : Number​

Threshold that controls the level of detail of loaded tiles. A higher value means tile traversal stops early, displaying lower quality tiles (but much faster load times & less bandwidth used), because we're using a high "error tolerance". A lower value means lower tolerance for error, so traversal goes deeper in the tree and displays higher quality tiles.

A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a radius equal to the tile's geometric error were rendered at the tile's position. If this value exceeds maximumScreenSpaceError the tile refines to its descendants.

Depending on the tileset, maximumScreenSpaceError may need to be tweaked to achieve the right balance between performance with visual quality. *

For formulas, projection-specific behavior, transform scaling, and tuning guidance, see Screen-space error and level of detail.

^default 8 * ^exception maximumScreenSpaceError must be greater than or equal to zero.

skipLevelOfDetail : Boolean​

Enables skip-LOD replacement traversal. When enabled, traversal may descend past one or more hierarchy levels without requesting every intermediate tile, while keeping ready replacement ancestors selected as temporary coverage. Request thresholds periodically load intermediate coverage on deep branches. This can improve first-detail latency at the cost of temporary ancestor/descendant overdraw. When zooming out to an unavailable level, already-drawn descendants within two levels remain selected alongside an available ancestor, preserving existing detail while the desired tile loads. This does not request additional descendant content. ADD refinement is unaffected.

Enabled by default for 3D Tiles. Set skipLevelOfDetail: false to request intermediate replacement levels as well. I3S retains its existing non-skipping default. Cold traversal still requests coarse coverage; immediatelyLoadDesiredLevelOfDetail remains disabled by default.

^default true for 3D Tiles; false for I3S

baseScreenSpaceError : Number​

When skip-LOD is enabled, replacement tiles above this SSE remain in the base traversal and are always requested. The active memory-adjusted SSE is used when it is higher than this value.

^default 1024

skipScreenSpaceErrorFactor : Number​

Minimum SSE reduction from the nearest requested or loaded ancestor before another intermediate tile is requested. For example, with the default factor, an ancestor at SSE 1600 allows an intermediate request below SSE 100 once skipLevels is also satisfied.

^default 16

skipLevels : Number​

Minimum number of hierarchy levels skipped between intermediate requests. Final desired tiles are still requested regardless of this value.

^default 1

immediatelyLoadDesiredLevelOfDetail : Boolean​

When skip-LOD is enabled, requests only final tiles that meet the active SSE target. Base and intermediate threshold requests are disabled. If a suitable ancestor is already loaded, it remains selected as fallback coverage while the desired content loads.

^default false

cacheBytes : Number​

The soft target in bytes for estimated tile content retained by the cache. The estimate includes geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also includes per-point metadata.

Tiles not needed in the current frame are unloaded in least-recently-used order to approach this target. Tiles used by the current frame remain protected.

If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.

If tiles sized more than cacheBytes are needed to meet the desired screen space error, determined by Tileset3D.maximumScreenSpaceError, for the current view, then the memory usage of the tiles loaded will exceed cacheBytes by up to maximumCacheOverflowBytes before memory-adjusted SSE raises the active threshold. When current-frame tiles go out of use, they become eligible for eviction.

^default 536870912 * ^exception cacheBytes must be a finite number greater than or equal to zero. ^see Tileset3D#gpuMemoryUsageInBytes

maximumCacheOverflowBytes : Number​

Additional current-frame memory headroom in bytes. When estimated usage exceeds cacheBytes + maximumCacheOverflowBytes and memory adjustment is enabled, memoryAdjustedScreenSpaceError rises incrementally to reduce future LOD demand. This value does not change the base target used to evict unused tiles.

^default 536870912 * ^exception maximumCacheOverflowBytes must be a finite number greater than or equal to zero.

root : Tile3D​

The root tile header.

boundingSphere : BoundingSphere​

The tileset's bounding sphere.

var tileset = viewer.scene.primitives.add(
new Tileset3D({
url: 'http://localhost:8002/tilesets/Seattle/tileset.json'
})
);

tileset.readyPromise.then(function (tileset) {
// Set the camera to view the newly added tileset
viewer.camera.viewBoundingSphere(tileset.boundingSphere, new HeadingPitchRange(0, -0.5, 0));
});

modelMatrix : Matrix4​

A 4x4 transformation matrix that transforms the entire tileset.

gpuMemoryUsageInBytes : Number​

The total amount of GPU memory in bytes used by the tileset. This value is estimated from geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also includes per-point metadata.

stats : Stats​

An instance of a probe.gl Stats object that contains information on how many tiles have been loaded etc. Easy to display using a probe.gl StatsWidget.

ellipsoid : Ellipsoid​

Gets an ellipsoid describing the shape of the globe.

Returns the extras property at the top-level of the tileset JSON, which contains application specific metadata. Returns undefined if extras does not exist.

Exception The tileset is not loaded. Use Tileset3D.readyPromise or wait for Tileset3D.ready to be true.

See Extras in the 3D Tiles specification.}

unloadTileset​

Unloads all tiles that weren't selected the previous frame. This can be used to explicitly manage the tile cache and reduce the total number of tiles loaded below Tileset3D.cacheBytes when unused content is available for eviction.

Tile unloads occur at the next frame to keep all the WebGL delete calls within the render loop.

isDestroyed() : Boolean​

Returns true if this object was destroyed; otherwise, false.

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in an exception.

^returns Boolean: true if this object was destroyed; otherwise, false.

destroy()​

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in an exception. Therefore, assign the return value undefined to the object as done in the example.

Wxception This object was destroyed, i.e., destroy() was called.

Methods​

setOptions​

setOptions(options: Object) : void:

Parameters:

  • options: the options map to apply

Apply new options to an instance of the class. Use this method to update options of the tileset during the run time.

update​

update(viewport: WebMercatorViewport) : Number:

Parameters:

Execute traversal under current viewport and fetch tiles needed for current viewport and update selectedTiles. Return frameNumber of this update frame.

I3S content options​

Tileset3DProps.i3s forwards format options to I3S content requests. A dedicated conversion runtime can set {geometryMode: 'source', decodeTextures: false, useCompressedTextures: false} to retain original-coordinate geometry and encoded PNG/JPEG resources. Rendering runtimes keep the default geometryMode: 'render'. This option does not select or supply CRS/elevation resources.