WebGLRenderingContext.depthMask()
WebGL API 的 WebGLRenderingContext.depthMask()
方法设置是否启用写入深度缓冲。
语法
void gl.depthMask(flag);
参数
flag
- 一个
GLboolean
(en-US) ,用于设置是否启用写入深度缓冲。默认值:true,表示启用写入。
返回值
无。
例子
gl.depthMask(false);
要获得当前的深度遮罩值,传入 DEPTH_WRITEMASK
常量,返回 Boolean
.
gl.getParameter(gl.DEPTH_WRITEMASK);
// false
规范
Specification | Status | Comment |
---|---|---|
WebGL 1.0 depthMask |
Recommendation | Initial definition. |
OpenGL ES 2.0 glDepthMask |
Standard | Man page of the OpenGL API. |
浏览器兼容性
No compatibility data found for api/WebGLRenderingContext
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.