A vertex attribute array; a collection of attribute state.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

  • Create a VAO.

    Parameters

    • program: Program

      The shader program associated with the VAO.

    • Optionalattributes: AttributeMap

      The attributes to attach to the VAO.

    • Optionalebo: Ebo

      The element buffer object to attach to the VAO.

    Returns Vao

    UnsupportedOperationError if a VAO cannot be created.

    BadValueError if an attribute is passed undefined as a value or if an unknown attribute is specified.

    createVertexArray

Properties

program: Program

The shader program associated with this VAO.

Accessors

Methods

  • Rasterize the vertex data contained within this VAO.

    Parameters

    • Optionaluniforms: UniformMap

      A collection of uniform values to set prior to rasterization.

    • primitive: Primitive = Primitive.TRIANGLES

      The type of primitive to rasterize.

    • offset: number = 0

      The number of elements to skip when rasterizing arrays, or the number of indices to skip when rasterizing elements.

    • framebuffer: null | Framebuffer = null

      The framebuffer to rasterize to, or null for the default framebuffer (canvas).

    Returns void

    BadValueError if a uniform is passed undefined as a value or if an unknown uniform is specified.

  • Set the value of an attribute in this VAO.

    Parameters

    • name: string

      The name of the attribute.

    • value: Vbo | AttributeValue

      The value to pass to the attribute.

    Returns void

    BadValueError if an unknown attribute is specified.