Firefox Tomorrow

web api instance method

WebGL2RenderingContext: vertexAttribDivisor() method

View on MDN ↗

Available in workers

The WebGL2RenderingContext.vertexAttribDivisor() method of the WebGL 2 API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawArraysInstanced() and gl.drawElementsInstanced().

[!NOTE] When using WebGL 1, the ANGLE_instanced_arrays extension can provide this method, too.

Syntax

vertexAttribDivisor(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

gl.vertexAttribDivisor(0, 2);

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also