buffers will have one GPUBuffer of usage GPUBufferUsage.VERTEX
indexBuffer will be GPUBuffer of usage GPUBufferUsage.INDEX
indexFormat will be uint32 (use a full spec or a typedarray of Uint16Array if you want 16bit indices)
numElements will be 36 (this is either the number entries in the array named indices or if no
indices are provided then it's the length of the first array divided by numComponents. See Arrays)
See Arrays for details on the various types of arrays.
Also see the cube and instancing examples.
Given arrays, create buffers, fills the buffers with data if provided, optionally interleaves the data (the default).
Example:
Where
bufferLayouts
will bebuffers
will have oneGPUBuffer
of usageGPUBufferUsage.VERTEX
indexBuffer
will beGPUBuffer
of usageGPUBufferUsage.INDEX
indexFormat
will beuint32
(use a full spec or a typedarray ofUint16Array
if you want 16bit indices)numElements
will be 36 (this is either the number entries in the array namedindices
or if no indices are provided then it's the length of the first array divided by numComponents. See Arrays)See Arrays for details on the various types of arrays. Also see the cube and instancing examples.