{{APIRef("WebGL")}} {{SeeCompatTable}}
The WebGLVertexArrayObject
interface is part of the WebGL 2 API, represents vertex array objects (VAOs) pointing to vertex array data, and provides names for different sets of vertex data.
When working with WebGLVertexArrayObject
objects, the following methods are useful:
- {{domxref("WebGL2RenderingContext.createVertexArray()")}}
- {{domxref("WebGL2RenderingContext.deleteVertexArray()")}}
- {{domxref("WebGL2RenderingContext.isVertexArray()")}}
- {{domxref("WebGL2RenderingContext.bindVertexArray()")}}
WebGL 1: The {{domxref("OES_vertex_array_object")}} extension allows you to use vertex array objects in a WebGL 1 context.
Examples
var vao = gl.createVertexArray(); gl.bindVertexArray(vao); // ... // calls to bindBuffer or vertexAttribPointer // which will be "recorded" in the VAO // ...
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('WebGL2', "#3.6", "WebGLVertexArrayObject")}} | {{Spec2('WebGL2')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatNo}} [2] | {{CompatNightly}} [1] | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
[1] WebGL 2 is enabled by default in Firefox Nightly. To enable it in a release version of Firefox, set the preference webgl.enable-prototype-webgl2
to true
in about:config.
[2] To use an experimental implementation of WebGL 2 in Chrome, you have to start Chrome with the runtime flag --enable-unsafe-es3-apis
.
See also
- {{domxref("OES_vertex_array_object")}}