drawArraysInstancedANGLE method

Render geometric primitives from bound and enabled instanced array vertex data. Call gl.getExtension("ANGLE_instanced_arrays") to enable ANGLE_instanced_arrays before using this method.




WebGLRenderingContext.drawArraysInstancedANGLE(mode, first, count, primcount);


mode [in]

Type: Number

Specifies the kind of geometric primitives to render from a given set of vertex attributes.


Draws a single dot per vertex. For example, 10 vertices produce 10 dots.


Draws a line between a pair of vertices. For example, 10 vertices produce 5 separate lines.


Draws a line to the next vertex by a straight line. For example, 10 vertices produce 9 lines connected end to end.


Similar to gl.LINE_STRIP, but connects the last vertex back to the first. For example, 10 vertices produce 10 straight lines.


Draws a triangle for each group of three consecutive vertices. For example, 12 vertices create 4 separate triangles.


Creates a strip of triangles where each additional vertex creates an additional triangle once the first three vertices have been drawn. For example, 12 vertices create 10 triangles.


Similar to gl.TRIANGLE_STRIP, but creates a fan shaped output. For example 12 vertices create 10 triangles.


first [in]

Type: Number

The first element to render in the array of vector points.

count [in]

Type: Number

The number of vector points to render. For example, a triangle would be 3.


Type: Number

The number of instances to render. Must be a gl.UNSIGNED_SHORT.

Return value

This method does not return a value.


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.

WebGL ErrorDescription
gl.INVALID_ENUMIf mode is not an accepted value.
gl.INVALID_VALUEIf first, count, or primcount, is negative.
gl.INVALID_FRAMEBUFFER_OPERATIONIf the currently bound WebGLFramebuffer is not framebuffer complete or the WebGLRenderbuffer is invalid.

The vertex attribute is enabled but no buffer is bound or if first + count goes past the end of the vertex attribute array.

For instanced drawing, there are no enabled vertex attribute arrays that have a divisor of zero and are bound to an active generic attribute value in the draw command program.


For Internet Explorer 11 using WebGL renderer 0.93 and later, GLSL point sizes up to 300 pixels are supported.

See also