Cesium3DTileset

A 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets.

try {
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Turn on camera collisions with the tileset.
try {
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json",
{ enableCollision: true }
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
skipLevelOfDetail: true,
baseScreenSpaceError: 1024,
skipScreenSpaceErrorFactor: 16,
skipLevels: 1,
immediatelyLoadDesiredLevelOfDetail: false,
loadSiblings: false,
cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
dynamicScreenSpaceError: true,
dynamicScreenSpaceErrorDensity: 2.0e-4,
dynamicScreenSpaceErrorFactor: 24.0,
dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);

Parameters

options

An object describing initialization options

See also

Constructors

Link copied to clipboard

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Initialization options for the Cesium3DTileset constructor

Properties

Link copied to clipboard

The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset is completely loaded for this view.

Link copied to clipboard
val asset: Any

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

Link copied to clipboard

Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.

Link copied to clipboard

The base path that non-absolute paths in tileset JSON file are relative to.

Link copied to clipboard

The screen space error that must be reached before skipping levels of detail.

Link copied to clipboard

The tileset's bounding sphere.

Link copied to clipboard

The amount of GPU memory (in bytes) used to cache tiles. This memory usage is estimated from geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also includes per-point metadata.

Link copied to clipboard

Determines whether terrain, 3D Tiles, or both will be classified by this tileset.

Link copied to clipboard

The ClippingPlaneCollection used to selectively disable rendering the tileset.

Link copied to clipboard

The ClippingPolygonCollection used to selectively disable rendering the tileset.

Link copied to clipboard

Defines the value used to linearly interpolate between the source color and feature color when the Cesium3DTileset.colorBlendMode is MIX. A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between resulting in a mix of the source color and feature color.

Link copied to clipboard

Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from the original feature, e.g. glTF material or per-point color in the tile.

Link copied to clipboard

Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.

Link copied to clipboard

Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.

Link copied to clipboard

A custom shader to apply to all tiles in the tileset. Only used for contents that use Model. Using custom shaders with a Cesium3DTileStyle may lead to undefined behavior.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

This property is for debugging only; it is not optimized for production use.

Link copied to clipboard

Optimization option. For street-level horizon views, use lower resolution tiles far from the camera. This reduces the amount of data loaded and improves tileset loading time with a slight drop in visual quality in the distance. This optimization is strongest when the camera is close to the ground plane of the tileset and looking at the horizon. Furthermore, the results are more accurate for tightly fitting bounding volumes like box and region.

Link copied to clipboard

Similar to Fog.density, this option controls the camera distance at which the Cesium3DTileset.dynamicScreenSpaceError optimization applies. Larger values will cause tiles closer to the camera to be affected. This value must be non-negative.

Link copied to clipboard

A parameter that controls the intensity of the Cesium3DTileset.dynamicScreenSpaceError optimization for tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight reduction of visual quality. The value must be non-negative.

Link copied to clipboard

A ratio of the tileset's height that determines "street level" for the Cesium3DTileset.dynamicScreenSpaceError optimization. When the camera is below this height, the dynamic screen space error optimization will have the maximum effect, and it will roll off above this value. Valid values are between 0.0 and 1.0.

Link copied to clipboard

Gets an ellipsoid describing the shape of the globe.

Link copied to clipboard

If true, allows collisions for camera collisions or picking. While this is true the camera will be prevented from going in or below the tileset surface if ScreenSpaceCameraController.enableCollisionDetection is true. This can have performance implecations if the tileset contains tile with a larger number of vertices.

Link copied to clipboard

The properties for managing dynamic environment maps on this model. Affects lighting.

Link copied to clipboard

Function for examining vector lines as they are being streamed.

Link copied to clipboard

Gets the tileset's extensions object property.

Link copied to clipboard
val extras: Any

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

Link copied to clipboard

Label of the feature ID set to use for picking and styling.

Link copied to clipboard

Optimization option. Used when Cesium3DTileset.foveatedScreenSpaceError is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and Cesium3DTileset.foveatedInterpolationCallback and Cesium3DTileset.foveatedMinimumScreenSpaceErrorRelaxation. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect.

Link copied to clipboard

Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between Cesium3DTileset.foveatedMinimumScreenSpaceErrorRelaxation and Cesium3DTileset.maximumScreenSpaceError.

Optimization option. Used when Cesium3DTileset.foveatedScreenSpaceError is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with this value up to Cesium3DTileset.maximumScreenSpaceError based on the provided Cesium3DTileset.foveatedInterpolationCallback.

Link copied to clipboard

Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the Cesium3DTileset.foveatedConeSize are loaded.

Link copied to clipboard

Optimization option. Used when Cesium3DTileset.foveatedScreenSpaceError is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.

Link copied to clipboard

The properties for managing image-based lighting on this tileset.

Link copied to clipboard

When true, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.

Link copied to clipboard

The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event is fired once when all tiles in the initial view are loaded.

Link copied to clipboard

Label of the instance feature ID set used for picking and styling.

Link copied to clipboard

The light color when shading models. When undefined the scene's light color is used instead.

Link copied to clipboard

The event fired to indicate progress of loading new tiles. This event is fired when a new tile is requested, when a requested tile is finished downloading, and when a downloaded tile has been processed and is ready to render.

Link copied to clipboard

Determines whether siblings of visible tiles are always downloaded during traversal. This may be useful for ensuring that tiles are already available when the viewer turns left/right.

Link copied to clipboard

The maximum additional amount of GPU memory (in bytes) that will be used to cache tiles.

Link copied to clipboard

The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile refines to its descendants, and therefore plays a major role in balancing performance with visual quality.

Link copied to clipboard

A 4x4 transformation matrix that transforms the entire tileset.

Link copied to clipboard

The color to use when rendering outlines.

Link copied to clipboard

Options for controlling point size based on geometric error and eye dome lighting.

Link copied to clipboard

Optimization option. Prefer loading of leaves first.

Link copied to clipboard

Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.

Link copied to clipboard

Preload tiles when tileset.show is false. Loads tiles as if the tileset is visible but does not render them.

Link copied to clipboard

Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of progressiveResolutionHeightFraction*screenHeight will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.

Link copied to clipboard

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

Link copied to clipboard

The resource used to fetch the tileset JSON file

Link copied to clipboard

The root tile.

Link copied to clipboard

Determines whether the tileset casts or receives shadows from light sources.

Link copied to clipboard

Determines if the tileset will be shown.

Link copied to clipboard

Determines whether the credits of the tileset will be displayed on the screen

Link copied to clipboard

Whether to display the outline for models using the CESIUM_primitive_outline extension. When true, outlines are displayed. When false, outlines are not displayed.

Link copied to clipboard

Optimization option. Determines if level of detail skipping should be applied during the traversal.

Link copied to clipboard

Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.

Link copied to clipboard

Multiplier defining the minimum screen space error to skip. For example, if a tile has screen space error of 100, no tiles will be loaded unless they are leaves or have a screen space error <= 100 / skipScreenSpaceErrorFactor.

Link copied to clipboard

The SplitDirection to apply to this tileset.

Link copied to clipboard

The style, defined using the 3D Tiles Styling language, applied to each feature in the tileset.

Link copied to clipboard

The event fired to indicate that a tile's content failed to load.

Link copied to clipboard

The event fired to indicate that a tile's content was loaded.

Link copied to clipboard

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

Link copied to clipboard

The event fired to indicate that a tile's content was unloaded.

Link copied to clipboard

This event fires once for each visible tile in a frame. This can be used to manually style a tileset.

Link copied to clipboard

Returns the time, in milliseconds, since the tileset was loaded and first updated.

Link copied to clipboard

The total amount of GPU memory in bytes used by the tileset. This value is estimated from geometry, texture, batch table textures, and binary metadata of loaded tiles.

Link copied to clipboard

Indicates that only the tileset's vector tiles should be used for classification.

Link copied to clipboard

Whether vector tiles should keep decoded positions in memory. This is used with Cesium3DTileFeature.getPolylinePositions.

Functions

Link copied to clipboard
fun 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.

Link copied to clipboard
fun getHeight(cartographic: Cartographic, scene: Scene): Double?

Get the height of the loaded surface at a given cartographic. This function will only take into account meshes for loaded tiles, not neccisarily the most detailed tiles available for a tileset. This function will always return undefined when sampling a point cloud.

Link copied to clipboard
fun hasExtension(extensionName: String): Boolean

true if the tileset JSON file lists the extension in extensionsUsed; otherwise, false.

Link copied to clipboard

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

Link copied to clipboard

Marks the tileset's Cesium3DTileset.style as dirty, which forces all features to re-evaluate the style in the next frame each is visible.

Link copied to clipboard

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 Cesium3DTileset.cacheBytes.