Renderer · interface

GpuDrivenMesh

One mesh of a GPU-driven scene: its vertices, its clusters, and which material shades it.

Explained in Hello world.

interface GpuDrivenMesh
import type { GpuDrivenMesh } from '@driftengine/core';

Properties

NameTypeDescription
positionsreadonlyFloat32ArrayThree floats a vertex.
normalsreadonlyFloat32ArrayThree floats a vertex.
coloursreadonlyFloat32ArrayThree floats a vertex.
uvsreadonlyoptionalFloat32ArrayTwo 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.
emissivereadonlyoptionalFloat32ArrayOne 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.
More

For 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 MeshData.

clustersreadonlyClusterSourceThis mesh's clusters, with indices addressing this mesh's vertices.
materialreadonlynumberWhich material bin every cluster of this mesh shades in.