An index buffer stores index values into a VertexBuffer. Indexed graphical primitives can normally utilize less memory that unindexed primitives (if vertices are shared).

Typically, index buffers are set on Mesh objects.

Constructors

  • Create a new IndexBuffer instance.

    Parameters

    Returns IndexBuffer

    Example

    // Create an index buffer holding 3 16-bit indices. The buffer is marked as
    // static, hinting that the buffer will never be modified.
    const indices = new UInt16Array([0, 1, 2]);
    const indexBuffer = new pc.IndexBuffer(graphicsDevice,
    pc.INDEXFORMAT_UINT16,
    3,
    pc.BUFFER_STATIC,
    indices);

Methods

  • Signals that the block of memory returned by a call to the lock function is ready to be given to the graphics hardware. Only unlocked index buffers can be set on the currently active device.

    Returns void