A vertex buffer is the mechanism via which the application specifies vertex data to the graphics hardware.

Constructors

  • Create a new VertexBuffer instance.

    Parameters

    • graphicsDevice: GraphicsDevice

      The graphics device used to manage this vertex buffer.

    • format: VertexFormat

      The vertex format of this vertex buffer.

    • numVertices: number

      The number of vertices that this vertex buffer will hold.

    • Optionaloptions: {
          data: ArrayBuffer;
          storage: boolean;
          usage: number;
      }

      Object for passing optional arguments.

      • data: ArrayBuffer

        Initial data.

      • storage: boolean

        Defines if the vertex buffer can be used as a storage buffer by a compute shader. Defaults to false. Only supported on WebGPU.

      • usage: number

        The usage type of the vertex buffer (see BUFFER_*). Defaults to BUFFER_STATIC.

    • Rest...args: any

    Returns VertexBuffer

Methods