WebGLVertexArrayObject
WebGLVertexArrayObject
接口是WebGL 2 API的一部分,顶点数组对象 (VAOs) 指向顶点数组数据,并提供不同顶点数据集合的名称。
当使用WebGLVertexArrayObject
对象时,这些方法会很有用:
WebGL2RenderingContext.createVertexArray()
WebGL2RenderingContext.deleteVertexArray()
(en-US)WebGL2RenderingContext.isVertexArray()
(en-US)WebGL2RenderingContext.bindVertexArray()
(en-US)
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
// ...
规范
Specification | Status | Comment |
---|---|---|
WebGL 2.0 WebGLVertexArrayObject |
Editor's Draft | Initial definition. |
浏览器兼容性
BCD tables only load in the browser