将规范化的深度范围(-1~+1)通过线性变换映射到(nearVal~farVal),这个范围不能超出(0~1)
这个函数的作用一般是分层渲染,比如要渲染一副从窗户看外面世界的场景,可以将外面场景的深度值映射为0.5~1,将室内场景深度值映射为0~0.5。再比如在场景上添加按钮,可以将场景深度值映射为0.1~1,按钮的深度值映射为0~0.1
void glDepthRange( GLdouble nearVal,
GLdouble farVal);
nearVal
Specifies the mapping of the near clipping plane to window coordinates. The initial value is 0.
farVal
Specifies the mapping of the far clipping plane to window coordinates. The initial value is 1.