Depth buffer values are clamped to that range because usually they are using fixed-point representation, so if clipping is disabled (by glEnable(GL_DEPTH_CLAMP)
) then they can't hold anything beyond that range.
However, there isn't really a good reason for this clamping when floating point depth buffers are used. In fact GL_NV_depth_buffer_float
extensions allows you to disable this clamping on Nvidia hardware for floating point buffers. Unfortunately other vendors don't have any documented way of doing that.
Also it's worth noting that unclamped floating point depth values have a minor complication: their depth offset is trickier to define. OpenGL spec resolves this by making the depth offset depend on the range of z-coordinates of the primitive. In fixed-point depth buffers, on the other hand, the offset is a function of the triangle slope only.