Renderer · function
packInstances
Interleave count instances into out, matrix, tint and opacity, at INSTANCE_FLOATS apart.
Explained in Hello world.
function packInstances(instances: MeshInstances, out: Float32Array): voidimport { packInstances } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
instances | MeshInstances | |
out | Float32Array |
In depth
Interleaved rather than two buffers so a batch's upload is one writeBuffer and an
instance's colour sits beside the matrix that places it. Shared by both backends, because
which floats go where is a decision and not a binding — the rule this repository draws around
resolveAtmosphere and resolvePointLights.
Writes nothing beyond count, and allocates nothing: out is the caller's staging array.