The ANGLE_instanced_arrays
extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type.
WebGL extensions are available using the WebGLRenderingContext.getExtension()
method. For more information, see also Using Extensions in the WebGL tutorial.
Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default and the constants and methods are available without the "ANGLE
" suffix.
Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. "ANGLE" just indicates that this extension has been written by the ANGLE library authors.
Constants
This extension exposes one new constant, which can be used in the gl.getVertexAttrib()
method:
ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE
- Returns a
GLint
describing the frequency divisor used for instanced rendering when used in thegl.getVertexAttrib()
as thepname
parameter.
Methods
This extension exposes three new methods.
ext.drawArraysInstancedANGLE()
- Behaves identically to
gl.drawArrays()
except that multiple instances of the range of elements are executed, and the instance advances for each iteration. ext.drawElementsInstancedANGLE()
- Behaves identically to
gl.drawElements()
except that multiple instances of the set of elements are executed and the instance advances between each set. ext.vertexAttribDivisorANGLE()
- Modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with
ext.drawArraysInstancedANGLE()
andext.drawElementsInstancedANGLE()
.
Examples
Enabling the extension:
var ext = gl.getExtension('ANGLE_instanced_arrays');
Specifications
Specification | Status | Comment |
ANGLE_instanced_arraysThe definition of 'ANGLE_instanced_arrays' in that specification. | Recommendation | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ANGLE_instanced_arrays
|
Chrome
Full support 32 |
Edge
Full support 12 |
Firefox
Full support 47 |
IE
Full support 11 |
Opera
Full support 19 |
Safari
Full support 7 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 32 |
Firefox Android
Full support Yes |
Opera Android
Full support 19 |
Safari iOS
Full support 8 |
Samsung Internet Android
Full support 2.0 |
drawArraysInstancedANGLE
|
Chrome
Full support 32 |
Edge
Full support 12 |
Firefox
Full support 47 |
IE
Full support 11 |
Opera
Full support 19 |
Safari
Full support 7 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 32 |
Firefox Android
Full support Yes |
Opera Android
Full support 19 |
Safari iOS
Full support 8 |
Samsung Internet Android
Full support 2.0 |
drawElementsInstancedANGLE
|
Chrome
Full support 32 |
Edge
Full support 12 |
Firefox
Full support 47 |
IE
Full support 11 |
Opera
Full support 19 |
Safari
Full support 7 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 32 |
Firefox Android
Full support Yes |
Opera Android
Full support 19 |
Safari iOS
Full support 8 |
Samsung Internet Android
Full support 2.0 |
vertexAttribDivisorANGLE
|
Chrome
Full support 32 |
Edge
Full support 12 |
Firefox
Full support 47 |
IE
Full support 11 |
Opera
Full support 19 |
Safari
Full support 7 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 32 |
Firefox Android
Full support Yes |
Opera Android
Full support 19 |
Safari iOS
Full support 8 |
Samsung Internet Android
Full support 2.0 |
Legend
- Full support
- Full support
See also
WebGLRenderingContext.getExtension()
WebGL2RenderingContext.drawArraysInstanced()
WebGL2RenderingContext.drawElementsInstanced()
WebGL2RenderingContext.vertexAttribDivisor()
ANGLE_instanced_arrays by Mozilla Contributors is licensed under CC-BY-SA 2.5.