Renderer · interface
GpuDrivenMesh
One mesh of a GPU-driven scene: its vertices, its clusters, and which material shades it.
Explained in Hello world.
interface GpuDrivenMeshimport type { GpuDrivenMesh } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
positionsreadonly | Float32Array | Three floats a vertex. |
normalsreadonly | Float32Array | Three floats a vertex. |
coloursreadonly | Float32Array | Three floats a vertex. |
uvsreadonlyoptional | Float32Array | Two floats a vertex. Optional: a mesh without them uploads zeros, and a textured material on it reads one texel everywhere and turns no normal — a statement about the mesh, and what the forward path does with an absent attribute. |
emissivereadonlyoptional | Float32Array | One float a vertex, added to the material's own emissive. Optional: a mesh without it glows as
its material says and nothing more, which is every mesh before 2026-09-18.MoreFor light a colour cannot carry. The voxel sandbox folds occlusion and sky light into the
vertex colour and keeps block light here, because it has to survive the sun going down and a
colour is multiplied by the sun. The forward path reads the same attribute from |
clustersreadonly | ClusterSource | This mesh's clusters, with indices addressing this mesh's vertices. |
materialreadonly | number | Which material bin every cluster of this mesh shades in. |