WebGL2RenderingContext.drawBuffers()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
WebGL 2 API的 WebGL2RenderingContext.drawBuffers()
方法定义了将写入零散数据(fragment colors)的绘制缓存 (draw buffer)。绘制缓存设置了上一次绑定帧缓存状态,如果没有帧缓存可用的话,则用绘制缓存。
语法
void gl.drawBuffers(buffers);
参数
返回值
没有。
报错信息
- 如果
buffers
包含了不止一个合法值,gl.INVALID_ENUM
错误会被抛出
示例
js
gl.drawBuffers([gl.NONE, gl.COLOR_ATTACHMENT1]);
规范
Specification |
---|
WebGL 2.0 Specification # 3.7.11 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
drawBuffers |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.