WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs 编辑

The WebGL2RenderingContext.invalidateSubFramebuffer() method of the WebGL 2 API invalidates portions of the contents of attachments in a framebuffer.

Syntax

void gl.invalidateSubFramebuffer(target, attachments, x, y, width, height);

Parameters

target
A GLenum specifying the binding point (target). Possible values:
  • gl.FRAMEBUFFER: Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image.
  • gl.DRAW_FRAMEBUFFER: Equivalent to gl.FRAMEBUFFER.
  • gl.READ_FRAMEBUFFER: Used as a source for reading operations.
attachments
An Array of GLenum specifying the attachment points to invalidate. Possible values:
  • gl.COLOR_ATTACHMENT{0-15}: Invalidates one of the framebuffer's color buffers.
  • gl.DEPTH_ATTACHMENT: Invalidates the framebuffer's depth buffer.
  • gl.STENCIL_ATTACHMENT: Invalidates the framebuffer's stencil buffer.
  • gl.DEPTH_STENCIL_ATTACHMENT: Invalidates both the framebuffer's depth and stencil buffer.
x
A GLint specifying the left origin of the pixel rectangle to invalidate.
y
A GLint specifying the bottom origin of the pixel rectangle to invalidate.
width
A GLsizei specifying the width of the pixel rectangle to invalidate.
height
A GLsizei specifying the height of the pixel rectangle to invalidate.

Return value

None.

Examples

gl.invalidateSubFramebuffer(gl.READ_FRAMEBUFFER,
                            [gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1],
                            0, 0, 256, 256);

Specifications

SpecificationStatusComment
WebGL 2.0
The definition of 'invalidateSubFramebuffer' in that specification.
Editor's DraftInitial definition for WebGL.
OpenGL ES 3.0
The definition of 'glInvalidateSubFramebuffer' in that specification.
StandardMan page of the (similar) OpenGL API.

Browser compatibility

BCD tables only load in the browser

See also

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

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

发布评论

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

词条统计

浏览:36 次

字数:4939

最后编辑:7年前

编辑次数:0 次

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