Create a new VertexBuffer instance.
The graphics device used to manage this vertex buffer.
The vertex format of this vertex buffer.
The number of vertices that this vertex buffer will hold.
Optional
options: { Object for passing optional arguments.
Initial data.
Defines if the vertex buffer can be used as a storage buffer by a compute shader. Defaults to false. Only supported on WebGPU.
The usage type of the vertex buffer (see BUFFER_*). Defaults to BUFFER_STATIC.
Rest
...args: anyReturns the data format of the specified vertex buffer.
The data format of the specified vertex buffer.
Returns the usage type of the specified vertex buffer. This indicates whether the buffer can be modified once and used many times BUFFER_STATIC, modified repeatedly and used many times BUFFER_DYNAMIC or modified once and used at most a few times BUFFER_STREAM.
The usage type of the vertex buffer (see BUFFER_*).
Returns a mapped memory block representing the content of the vertex buffer.
An array containing the byte data stored in the vertex buffer.
Copies data into vertex buffer's memory.
Optional
data: ArrayBufferSource data to copy.
True if function finished successfully, false otherwise.
A vertex buffer is the mechanism via which the application specifies vertex data to the graphics hardware.