Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1032424 of WebGLVertexArrayObject

  • Revision slug: Web/API/WebGLVertexArrayObject
  • Revision title: WebGLVertexArrayObject
  • Revision id: 1032424
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment new page

Revision Content

{{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")}}

Revision Source

<div>{{APIRef("WebGL")}} {{SeeCompatTable}}</div>

<p>The <strong><code>WebGLVertexArrayObject</code></strong> interface is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL 2 API</a>, represents vertex array objects (VAOs) pointing to vertex array data, and provides names for different sets of vertex data.</p>

<p>When working with <code>WebGLVertexArrayObject</code> objects, the following methods are useful:</p>

<ul>
 <li>{{domxref("WebGL2RenderingContext.createVertexArray()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.deleteVertexArray()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.isVertexArray()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.bindVertexArray()")}}</li>
</ul>

<div class="note">
<p><strong>WebGL 1:</strong> The {{domxref("OES_vertex_array_object")}} extension allows you to use vertex array objects in a WebGL 1 context.</p>
</div>

<h2 id="Examples">Examples</h2>

<pre class="brush: js">
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
// calls to bindBuffer or vertexAttribPointer 
// which will be "recorded" in the VAO
// ...</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('WebGL2', "#3.6", "WebGLVertexArrayObject")}}</td>
   <td>{{Spec2('WebGL2')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}} [2]</td>
   <td>{{CompatNightly}} [1]</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] WebGL 2 is enabled by default in Firefox Nightly. To enable it in a release version of Firefox, set the preference <code>webgl.enable-prototype-webgl2</code> to <code>true</code> in about:config.</p>

<p>[2] To use an experimental implementation of WebGL 2 in Chrome, you have to start Chrome with the runtime flag <code>--enable-unsafe-es3-apis</code>.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("OES_vertex_array_object")}}</li>
</ul>
Revert to this revision