web api instance method
WebGL2RenderingContext: vertexAttribDivisor() method
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, theANGLE_instanced_arraysextension can provide this method, too.
Syntax
vertexAttribDivisor(index, divisor)
Parameters
index- : A
GLuintspecifying the index of the generic vertex attributes.
- : A
divisor- : A
GLuintspecifying the number of instances that will pass between updates of the generic attribute.
- : A
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.