WebGLVertexArrayObject
注意:此功能在 Web Workers 中可用。
WebGLVertexArrayObject 介面是 WebGL 2 API 的一部分,它代表指向頂點陣列資料的頂點陣列物件 (VAO),併為不同的頂點資料集合提供名稱。
在使用 WebGLVertexArrayObject 物件時,以下方法很有用:
WebGL2RenderingContext.createVertexArray()WebGL2RenderingContext.deleteVertexArray()WebGL2RenderingContext.isVertexArray()WebGL2RenderingContext.bindVertexArray()
注意: OES_vertex_array_object 擴充套件允許你在 WebGL 1 上下文中使用頂點陣列物件。
示例
js
const vao = gl.createVertexArray();
gl.bindVertexArray(vao);
// …
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// …
規範
| 規範 |
|---|
| WebGL 2.0 規範 # 3.6 |
瀏覽器相容性
載入中…