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 |
浏览器兼容性
加载中…