Vertex layouts for an unlit pipeline, in slot order: position always,
then colours if the variant reads them, then uvs if it samples a texture.
Separate buffers rather than one interleaved one, matching gl-geometry.ts:
BufferGeometry holds each stream as its own typed array, so one buffer per
stream is a straight upload with no CPU-side interleave pass.
Slot index is positional, not fixed per stream — a textured, uncoloured
variant binds its uvs to slot 1, a textured and coloured one to slot 2 — so
the renderer's setVertexBuffer order has to be built in the same order this
function is. It is, and both are a single counter, which is why the ordering
is stated here rather than left to be inferred: the failure mode of getting
it wrong is a pipeline reading colours as uvs, which validates cleanly and
draws garbage.
Vertex layouts for an unlit pipeline, in slot order: position always, then colours if the variant reads them, then uvs if it samples a texture.
Separate buffers rather than one interleaved one, matching
gl-geometry.ts:BufferGeometryholds each stream as its own typed array, so one buffer per stream is a straight upload with no CPU-side interleave pass.Slot index is positional, not fixed per stream — a textured, uncoloured variant binds its uvs to slot 1, a textured and coloured one to slot 2 — so the renderer's
setVertexBufferorder has to be built in the same order this function is. It is, and both are a single counter, which is why the ordering is stated here rather than left to be inferred: the failure mode of getting it wrong is a pipeline reading colours as uvs, which validates cleanly and draws garbage.