MeshSource
A source of static mesh geometry shared by one or more mesh layers.
Geometry is loaded on the first call to load and retained by the source. Each layer's renderable references the same CPU arrays and uses separate GPU buffers. The loader supports static, uncompressed GLB meshes. Scene transforms are baked into the geometry and missing normals are generated for flat shading. Materials, textures, and animation are ignored. The base geometry is rendered without skinning or morph deformations. Mesh layers supply their own color and lighting. Instancing and required glTF extensions are not supported.
const source = new MeshSource({
url: "https://example.com/mesh.glb",
});
const layer = new MeshLayer({
source,
color: Color.RED,
});Constructor
Creates a mesh source without loading its geometry.
new MeshSource(props): MeshSource;| Parameter | Description |
|---|---|
props: MeshSourceProps | Initialization properties. |
Types
MeshSourceProps
Initialization properties for constructing a mesh source.
| Property | Description |
|---|---|
url: string | The source URL passed to the mesh loader. |
Properties
url
The source URL passed to the mesh loader.
readonly url: string;Methods
load() Promise<Geometry>
Returns the source's CPU geometry, loading it on the first call.
Concurrent and subsequent calls share the same promise and geometry. A failed load clears the cached promise so a later call can retry.
load(): Promise<Geometry>;