STATIC SUB DepthRange ( Near AS Float, Far AS Float )
After clipping and division by w, z coordinates range from -1.0 to 1.0, corresponding to the near and far clipping planes. Gl.DepthRange specifies a linear mapping of the normalized z coordinates in this range to window z coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0.0 through 1.0 (like color components). Thus, the values accepted by Gl.DepthRange are both clamped to this range before they are accepted.
The default mapping of 0, 1 maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized.
![]() | It is not necessary, that Near be less than Far. Reverse mappings such as 1, 0 are acceptable. |
Gl.GL_INVALID_OPERATION is generated if Gl.DepthRange is called between a call to Gl.Begin and the corresponding call to Gl.End.
Gl.GetDepthRange