-
new VertexArrayObject(gl, id, params)
-
VAO
Name Type Description glWebGLRenderingContext idString 缓存id
paramsObject
Members Show Inherited
-
static,readonlyVertexArrayObject.cacheCache
-
缓存
Methods Show Inherited
-
staticVertexArrayObject.getVao(gl, id, params){VertexArrayObject}
-
获取 vao
Name Type Description glWebGLRenderingContext idString 缓存id
paramsObject Returns:
Type Description VertexArrayObject -
staticVertexArrayObject.reset(gl)
-
重置所有vao
Name Type Description glWebGLRenderingContext -
staticVertexArrayObject.bindSystemVao()
-
绑定系统vao
-
bind
-
unbind()
-
unbind
-
draw
-
getVertexCount(){Number}
-
获取顶点数量
Returns:
Type Description Number 顶点数量 -
drawInstance(primcount)
-
drawInstance
Name Type Default Description primcountNumber 1 optional -
addIndexBuffer(data, usage){Buffer}
-
addIndexBuffer
Name Type Description dataGeometryData usageGLenum gl.STATIC_DRAW|gl.DYNAMIC_DRAW
Returns:
Type Description Buffer Buffer -
addAttribute(geometryData, attribute, usage, onInit){AttributeObject}
-
addAttribute
Name Type Description geometryDataGeometryData attributeObject usageGLenum gl.STATIC_DRAW|gl.DYNAMIC_DRAW
onInitfunction Returns:
Type Description AttributeObject attributeObject -
addInstancedAttribute(attribute, meshes, getData){AttributeObject}
-
addInstancedAttribute
Name Type Description attributeObject meshesArray getDatafunction Returns:
Type Description AttributeObject attributeObject -
getResources(resources){Array.<Object>}
-
获取资源
Name Type Default Description resourcesArray.<Object> [] optional Returns:
Type Description Array.<Object> -
destroyIfNoRef(renderer){VertexArrayObject}
-
没有被引用时销毁资源
Name Type Description rendererWebGLRenderer Returns:
Type Description VertexArrayObject this -
destroy(){VertexArrayObject}
-
销毁资源
Returns:
Type Description VertexArrayObject this