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.

IE11

 

Syntax

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

Parameters

mode [in]

Type: Number

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

ValueMeaning
gl.POINTS

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

gl.LINES

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

gl.LINE_STRIP

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

gl.LINE_LOOP

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

gl.TRIANGLES

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

gl.TRIANGLE_STRIP

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.

gl.TRIANGLE_FAN

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.

primcount

Type: Number

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

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.

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.
gl.INVALID_OPERATION

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

WebGLRenderingContext
ANGLE_instanced_arrays

 

 

Show: