createGlyphField#positionsBuffer¶
Summary¶
createGlyphField#positionsBuffer exposes the GPU storage for per-glyph positions. Each row belongs to the same instance across positions, rotations, scales and optional attributes. Use these handles when sharing instance storage with a GPU pass.
Syntax¶
GlyphField.positionsBuffer: GPUBuffer | null
GlyphField.rotationsBuffer: GPUBuffer | null
GlyphField.scalesBuffer: GPUBuffer | null
GlyphField.attributesBuffer: GPUBuffer | null
const positions = field.positionsBuffer;
Returns¶
GPUBuffer | null - Each current channel buffer stores one packed vec4<f32> per instance. Positions and scales use the first three lanes, and rotations use [x, y, z, w] quaternions. A channel can be null before upload. Without an attribute source, attributesBuffer may hold a placeholder for rendering, so only use it as per-instance data when you have configured that channel.
Notes¶
Read the handles again after switching sources or growing Wasm-backed buffers. Use setBuffers to replace the buffer set and specify its ownership and active count.