MDN self-hosted library · e01.org

ANGLE_instanced_arrays: vertexAttribDivisorANGLE() method

WebGL

WebGL

The ANGLE_instanced_arrays.vertexAttribDivisorANGLE() method of the WebGL API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawArraysInstancedANGLE() and ext.drawElementsInstancedANGLE().

[!NOTE] When using WebGL2, this method is available as gl.vertexAttribDivisor() by default.

Syntax

vertexAttribDivisorANGLE(index, divisor)

Parameters

  • index
  • : A GLuint specifying the index of the generic vertex attributes.
  • divisor
  • : A GLuint specifying the number of instances that will pass between updates of the generic attribute.

Return value

None (undefined).

Examples

const ext = gl.getExtension("ANGLE_instanced_arrays");
ext.vertexAttribDivisorANGLE(0, 2);

Specifications

Browser compatibility

See also

  • ext.drawArraysInstancedANGLE()
  • ext.drawElementsInstancedANGLE()
  • WebGLRenderingContext.drawArrays()
  • WebGLRenderingContext.drawElements()
  • WebGL2RenderingContext.drawArraysInstanced()
  • WebGL2RenderingContext.drawElementsInstanced()
  • WebGL2RenderingContext.vertexAttribDivisor()