Model
Cesium supports glTF assets with the following extensions:
Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions for maximum compatibility. This is because some samplers require power of 2 textures (Using textures in WebGL) and KHR_texture_basisu requires multiple of 4 dimensions (KHR_texture_basisu additional requirements).
See also
Properties
The currently playing glTF animations.
Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if Model.color is translucent or Model.silhouetteSize is greater than 0.0.
Gets the model's bounding sphere in world space. This does not take into account glTF animations, skins, or morph targets. It also does not account for Model.minimumPixelSize.
Determines if the model's animations should hold a pose over frames where no keyframes are specified.
Gets the model's classification type. This determines whether terrain, 3D Tiles, or both will be classified by this model.
The ClippingPlaneCollection used to selectively disable rendering the model.
The ClippingPolygonCollection used to selectively disable rendering the model.
Value used to determine the color strength when the colorBlendMode
is MIX
. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
Defines how the color blends with the model.
The model's custom shader, if it exists. Using custom shaders with a Cesium3DTileStyle may lead to undefined behavior.
This property is for debugging only; it is not for production use nor is it optimized.
This property is for debugging only; it is not for production use nor is it optimized.
Gets or sets the distance display condition, which specifies at what distance from the camera this model will be displayed.
If true
, the model is exaggerated along the ellipsoid normal when Scene.verticalExaggeration is set to a value other than 1.0
.
The properties for managing dynamic environment maps on this model. Affects lighting.
Gets an event that is raised when the model encounters an asynchronous rendering error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of ModelError.
Label of the feature ID set to use for picking and styling.
The height reference of the model, which determines how the model is drawn relative to terrain.
The properties for managing image-based lighting on this model.
Label of the instance feature ID set used for picking and styling.
The directional light color when shading the model. When undefined
the scene's light color is used instead.
The maximum scale size for a model. This can be used to give an upper limit to the Model.minimumPixelSize, ensuring that the model is never an unreasonable scale.
The approximate minimum pixel size of the model regardless of zoom. This can be used to ensure that a model is visible even when the viewer zooms out. When 0.0
, no minimum size is enforced.
The 4x4 transformation matrix that transforms the model from model to world coordinates. When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by Transforms.eastNorthUpToFixedFrame.
The color to use when rendering outlines.
Point cloud shading settings for controlling point cloud attenuation and lighting. For 3D Tiles, this is inherited from the Cesium3DTileset.
Gets an event that is raised when the model is loaded and ready for rendering, i.e. when the external resources have been downloaded and the WebGL resources are created. Event listeners are passed an instance of the Model.
A uniform scale applied to this model before the Model.modelMatrix. Values greater than 1.0
increase the size of the model; values less than 1.0
decrease.
Determines whether the model casts or receives shadows from light sources.
Gets or sets whether the credits of the model 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.
The silhouette color.
The size of the silhouette in pixels.
The SplitDirection to apply to this model.
The style to apply to the features in the model. Cannot be applied if a CustomShader is also applied.
Gets an event that, if Model.incrementallyLoadTextures is true, is raised when the model textures are loaded and ready for rendering, i.e. when the external resources have been downloaded and the WebGL resources are created. Event listeners are passed an instance of the Model.
Functions
Applies any modified articulation stages to the matrix of each node that participates in any articulation. Note that this will overwrite any node transformations on participating nodes.
Returns the object that was created for the given extension.
Returns true if this object was destroyed; otherwise, false.
Marks the model's Model.style as dirty, which forces all features to re-evaluate the style in the next frame the model is visible.
Sets the current value of an articulation stage. After setting one or multiple stage values, call Model.applyArticulations() to cause the node matrices to be recalculated.
Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.