WebGLRenderingContext.depthMask()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebGL API 的 WebGLRenderingContext.depthMask()
方法设置是否启用写入深度缓冲。
语法
void gl.depthMask(flag);
参数
返回值
无。
例子
js
gl.depthMask(false);
要获得当前的深度遮罩值,传入 DEPTH_WRITEMASK
常量,返回 Boolean
.
js
gl.getParameter(gl.DEPTH_WRITEMASK);
// false
规范
Specification |
---|
WebGL Specification # 5.14.3 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
depthMask |
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.