vertexAttribDivisorANGLE method

Sets the advance rate for vertex attributes when rendering multiple instances using drawArraysInstancedANGLE or drawElementsInstancedANGLE. This method is enabled using ANGLE_instanced_arrays.

IE11

 

Syntax

object.vertexAttribDivisorANGLE(index, divisor)

Parameters

index [in]

Type: Number

Location of attribute.

divisor [in]

Type: Number

Specifies the rate that the attributes advance per vertex. A value of 0 means it isn't instanced. A value of 1 means every attribute is used once for each instanced vertex. A value of two repeats each attribute twice per vertex, and so forth.

Return value

This method does not return a value.

Remarks

Instancing is only supported on Microsoft Direct3D 10+ GPUs. It isn't supported on Microsoft Direct3D 9-capable GPUs, commonly found on phones and some tablets.

When performing an instanced draw, at least one enabled vertex attribute array that is bound to an active generic attribute value must have a divisor of zero.

WebGL ErrorDescription
gl.INVALID_VALUEIf index is greater than or equal to MAX_VERTEX_ATTRIBS.

 

See also

ANGLE_instanced_arrays

 

 

Show: