An object-oriented representation of an attribute in a GLSL shader program.

Implements

Constructors

Accessors

  • get index(): number
  • Returns the cached index obtained by calling getAttribLocation on the WebGLRenderingContext.

    Returns number

  • set index(unused): void
  • Parameters

    • unused: number

    Returns void

Methods

  • Specifies the data formats and locations of vertex attributes in a vertex attributes array. Calls the vertexAttribPointer method on the underlying WebGLRenderingContext using the cached attribute index and the supplied parameters. Note that the type parameter is hard-code to FLOAT.

    Parameters

    • size: number

      The number of components per attribute. Must be 1, 2, 3, or 4.

    • type: DataType

      The data type of each component in the array.

    • normalized: boolean = false

      Specifies whether fixed-point data values should be normalized (true), or are converted to fixed point vales (false) when accessed.

    • stride: number = 0

      The distance in bytes between the beginning of consecutive vertex attributes.

    • offset: number = 0

      The offset in bytes of the first component in the vertex attribute array. Must be a multiple of type.

    Returns void

  • Notifies this Attrib of a browser gain WebGL context event. This Attrib responds by obtaining and caching attribute index.

    Parameters

    • context: WebGL2RenderingContext | WebGLRenderingContext
    • program: WebGLProgram

    Returns void

  • Calls the disableVertexAttribArray method on the underlying WebGLRenderingContext using the cached attribute index.

    Returns void

  • Calls the enableVertexAttribArray method on the underlying WebGLRenderingContext using the cached attribute index.

    Returns void

  • Returns the address of the specified vertex attribute. Experimental.

    Returns number

  • Returns a non-normative string representation of the GLSL attribute.

    Returns string