From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../webgl2renderingcontext/drawbuffers/index.html | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 files/zh-cn/web/api/webgl2renderingcontext/drawbuffers/index.html (limited to 'files/zh-cn/web/api/webgl2renderingcontext/drawbuffers') diff --git a/files/zh-cn/web/api/webgl2renderingcontext/drawbuffers/index.html b/files/zh-cn/web/api/webgl2renderingcontext/drawbuffers/index.html new file mode 100644 index 0000000000..9a8f3f6797 --- /dev/null +++ b/files/zh-cn/web/api/webgl2renderingcontext/drawbuffers/index.html @@ -0,0 +1,75 @@ +--- +title: WebGL2RenderingContext.drawBuffers() +slug: Web/API/WebGL2RenderingContext/drawBuffers +translation_of: Web/API/WebGL2RenderingContext/drawBuffers +--- +
{{APIRef("WebGL")}} {{SeeCompatTable}}
+ +

WebGL 2 APIWebGL2RenderingContext.drawBuffers()  方法定义了将写入零散数据(fragment colors)的绘制缓存(draw buffer)。绘制缓存设置了上一次绑定帧缓存状态,如果没有帧缓存可用的话,则用绘制缓存。

+ +

语法

+ +
void gl.drawBuffers(buffers);
+
+ +

参数

+ +
+
buffers
+
一个 {{domxref("GLenum")}}的{{jsxref("Array")}}} 对碎片颜色的说明将被写入缓冲区。可能的值有: +
    +
  • gl.NONE: 碎片着色器的输出没有被写入到任何颜色缓存中。
  • +
  • gl.BACK: 碎片着色器的输出被写入到返回的颜色缓存中。
  • +
  • gl.COLOR_ATTACHMENT{0-15}: 碎片着色器的输出被写入当前帧缓存的第n个颜色缓存中。Fragment shader output is written in the nth color attachment of the current framebuffer.
  • +
+
+
+ +

返回值

+ +

没有。

+ +

报错信息

+ + + +

例子

+ +
gl.drawBuffers([gl.NONE, gl.COLOR_ATTACHMENT1]);
+
+ +

详情

+ + + + + + + + + + + + + + + + + + + +
详情状态用法(Comment)
{{SpecName('WebGL2', "#3.7.11", "drawBuffers")}}{{Spec2('WebGL2')}}Initial definition for WebGL.
{{SpecName('OpenGL ES 3.0', "glDrawBuffers.xhtml", "glDrawBuffers")}}{{Spec2('OpenGL ES 3.0')}}Man page of the (similar) OpenGL API.
+ +

浏览器兼容性

+ + + +

{{Compat("api/WebGL2RenderingContext", "WebGL2RenderingContext.drawBuffers")}}

+ +

详见

+ + -- cgit v1.2.3-54-g00ecf