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
bufferLayoutswill bebufferswill have oneGPUBufferof usageGPUBufferUsage.VERTEXindexBufferwill beGPUBufferof usageGPUBufferUsage.INDEXindexFormatwill beuint32(use a full spec or a typedarray ofUint16Arrayif you want 16bit indices)numElementswill be 36 (this is either the number entries in the array namedindicesor 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.