docs.rodeo

MDN Web Docs mirror

WebGL2RenderingContext: drawArraysInstanced() method

{{APIRef("WebGL")}} {{AvailableInWorkers}} 

The WebGL2RenderingContext.drawArraysInstanced() method of the WebGL 2 API renders primitives from array data like the {{domxref("WebGLRenderingContext.drawArrays()", "gl.drawArrays()")}}  method. In addition, it can execute multiple instances of the range of elements.

[!NOTE] When using {{domxref("WebGLRenderingContext", "WebGL 1", "", 1)}} , the {{domxref("ANGLE_instanced_arrays")}}  extension can provide this method, too.

Syntax

drawArraysInstanced(mode, first, count, instanceCount)

Parameters

Return value

None ({{jsxref("undefined")}} ).

Examples

gl.drawArraysInstanced(gl.POINTS, 0, 8, 4);

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN