WebGL
**WebGLVertexArrayObject**接口是WebGL 2 API的一部分,顶点数组对象 (VAOs) 指向顶点数组数据,并提供不同顶点数据集合的名称。
当使用WebGLVertexArrayObject对象时,这些方法会很有用:
- WebGL2RenderingContext.createVertexArray()
- WebGL2RenderingContext.deleteVertexArray()
- WebGL2RenderingContext.isVertexArray()
- WebGL2RenderingContext.bindVertexArray()
[!NOTE] WebGL 1: OES_vertex_array_object 扩展允许你在 WebGL 1 上下文环境中使用顶点数组对象。
示例
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);
// ...
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...
规范
浏览器兼容性
相关链接
- OES_vertex_array_object
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
