Graphics Reference
In-Depth Information
Figure 3.48. The change from one coordinate space to another.
range in the post- W -divide range. Thus, we have two different ways to express the post-
projection coordinates—before and after the W -divide. We will refer to the pre-divide coor-
dinates as residing in clip space, and we will refer to the post-divide coordinates simply as
normalized device coordinates. This distinction is very important, since both coordinates
describe the same point, but their values will vary significantly between the two. The vari-
ous coordinate spaces and the operations that produce them are shown in Figure 3.48.
As we noted above, the position received by the rasterizer stage in the SV_Position
system value semantic should be the result of the projection transformation, and hence
should be in clip space. The rasterizer stage performs the W -divide later in its sequence
of processing, so the shader program that performs the projection transformation doesn't
need to manually execute the division. 2 7
In
many cases, it can often be easier to visualize
the post-projection coordinates in terms of the
normalized device coordinates when consider-
ing whether a particular vertex will be visible or
not. In these normalized device coordinates, a
vertex must reside within the cube between the
points [1,1,1] and [-1,-1,0]. This range of coor-
dinates is depicted in Figure 3.49.
As we can see in Figure 3.49, the positive
X-axis points to the right, the positive 7-axis
points upward, and the positive Z-axis points
Figure 3.49. A visualization of the region
where vertices are within the current view-
ing area.
2 7
This doesn't mean that the shader can't perform the W-divide if it needs to for further calculations. If so, the
rasterizer stage will simply divide the other coordinates by 1, which will of course produce the same result.
Search WWH ::




Custom Search