ANGLE_instanced_arrays - Web APIs 编辑

The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type.

WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial.

Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default and the constants and methods are available without the "ANGLE" suffix.

Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. "ANGLE" just indicates that this extension has been written by the ANGLE library authors.

Constants

This extension exposes one new constant, which can be used in the gl.getVertexAttrib() method:

ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE
Returns a GLint describing the frequency divisor used for instanced rendering when used in the gl.getVertexAttrib() as the pname parameter.

Methods

This extension exposes three new methods.

ext.drawArraysInstancedANGLE()

Behaves identically to gl.drawArrays() except that multiple instances of the range of elements are executed, and the instance advances for each iteration.

ext.drawElementsInstancedANGLE()

Behaves identically to gl.drawElements() except that multiple instances of the set of elements are executed and the instance advances between each set.

ext.vertexAttribDivisorANGLE()

Modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawArraysInstancedANGLE() and ext.drawElementsInstancedANGLE().

Examples

Enabling the extension:

var ext = gl.getExtension('ANGLE_instanced_arrays');

Specifications

SpecificationStatusComment
ANGLE_instanced_arrays
The definition of 'ANGLE_instanced_arrays' in that specification.
RecommendationInitial definition.

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:68 次

字数:5558

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文