pub struct InstanceBuffer {
pub id: BufferId,
pub source: BufferSource,
pub count: usize,
pub item_size: usize,
pub per_vertex: bool,
}Expand description
The CPU-side buffer behind one or more instanced vertex attributes —
three.js’ InstancedBufferAttribute / InstancedInterleavedBuffer.
RangeNode.setup() and createInstanceMatrixNode() both branch on
uniformBufferSize <= builder.getUniformBufferLimit(): under the limit the
data is a uniform buffer indexed by instanceIndex (BufferNode), over it
an instanced attribute, which is what lifts the ~1024-instance cap the
64 KiB uniform binding imposes. Rc identity is the buffer’s identity, so
two range( 0, 1 ) calls are two buffers with two different random fills,
exactly as two RangeNodes are in three.js.
Fields§
§id: BufferIdThis buffer’s identity — see BufferId.
source: BufferSourceWhere the buffer’s contents come from.
count: usizeThe instance count — InstancedBufferAttribute.count.
item_size: usizeFloats per instance, i.e. the attribute stride in components: 16 for the
interleaved instance matrix (new InstancedInterleavedBuffer( array, 16, 1 )), 4 for a range().
per_vertex: boolThe buffer steps once per vertex: attributeArray()’s
StorageBufferAttribute read through .toAttribute(), which is not an
InstancedBufferAttribute. false for everything else here.