are divided by their fourth coordinate.
The x and y components of the position in clip coordinates are roughly what we need to
access the shadow map. The z coordinate contains the depth information that we can use to
compare with the shadow map. However, before we can use these values we need to do two
things. First, we need to bias them so that they range from zero to one (instead of -1 to 1), and
second, we need to apply perspective division (more on this later).
In clip coordinates (after perspective division) the z coordinate ranges from
-1 to 1. It is the viewport transformation that (among other things) converts
the depth to a range between zero and one. Incidentally, if so desired, we can
configure the viewport transformation to use some other range for the depth
values (say between 0 and 100) via the function glDepthRange.
简单来说就是经过透视变化后各个坐标除以w,在(-1,-1,-1)到(1,1,1)的Cube里。