files/en-us/web/api/webglrenderingcontext/depthrange/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGLRenderingContext.depthRange() method of the WebGL API specifies the depth range mapping
from normalized device coordinates to window or viewport coordinates.
depthRange(zNear, zFar)
zNear
zFar. The default value is 0.zFar
None ({{jsxref("undefined")}}).
gl.depthRange(0.2, 0.6);
To check the current depth range, query the DEPTH_RANGE constant which
returns a {{jsxref("Float32Array")}}
gl.getParameter(gl.DEPTH_RANGE);
// Float32Array[0.2, 0.6]
{{Specifications}}
{{Compat}}