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
An object describing initialization options
See also
Types
Initialization options for the Cesium3DTileset constructor
Properties
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.
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.
The screen space error that must be reached before skipping levels of detail.
The tileset's bounding sphere.
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.
Determines whether terrain, 3D Tiles, or both will be classified by this tileset.
The ClippingPlaneCollection used to selectively disable rendering the tileset.
The ClippingPolygonCollection used to selectively disable rendering the tileset.
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.
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.
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.
Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
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.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
This property is for debugging only; it is not optimized for production use.
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.
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.
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.
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.
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.
The properties for managing dynamic environment maps on this model. Affects lighting.
Function for examining vector lines as they are being streamed.
Gets the tileset's extensions object property.
Label of the feature ID set to use for picking and styling.
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.
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.
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.
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.
The properties for managing image-based lighting on this tileset.
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.
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.
Label of the instance feature ID set used for picking and styling.
The light color when shading models. When undefined
the scene's light color is used instead.
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.
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.
The maximum additional amount of GPU memory (in bytes) that will be used to cache tiles.
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.
A 4x4 transformation matrix that transforms the entire tileset.
The color to use when rendering outlines.
Options for controlling point size based on geometric error and eye dome lighting.
Optimization option. Prefer loading of leaves first.
Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
Preload tiles when tileset.show
is false
. Loads tiles as if the tileset is visible but does not render them.
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.
Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
The root tile.
Determines whether the tileset casts or receives shadows from light sources.
Determines whether the credits of the tileset will be displayed on the screen
Whether to display the outline for models using the CESIUM_primitive_outline extension. When true, outlines are displayed. When false, outlines are not displayed.
Optimization option. Determines if level of detail skipping should be applied during the traversal.
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.
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
.
The SplitDirection to apply to this tileset.
The style, defined using the 3D Tiles Styling language, applied to each feature in the tileset.
The event fired to indicate that a tile's content failed to load.
The event fired to indicate that a tile's content was loaded.
When true
, all tiles that meet the screen space error this frame are loaded. The tileset is completely loaded for this view.
The event fired to indicate that a tile's content was unloaded.
This event fires once for each visible tile in a frame. This can be used to manually style a tileset.
Returns the time, in milliseconds, since the tileset was loaded and first updated.
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.
Indicates that only the tileset's vector tiles should be used for classification.
Whether vector tiles should keep decoded positions in memory. This is used with Cesium3DTileFeature.getPolylinePositions.
Functions
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.
true
if the tileset JSON file lists the extension in extensionsUsed; otherwise, false
.
Returns true if this object was destroyed; otherwise, false.
Marks the tileset's Cesium3DTileset.style as dirty, which forces all features to re-evaluate the style in the next frame each is visible.
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.