Graphics Reference
In-Depth Information
3.10.1 Rasterizer Stage Pipeline Input
The rasterizer stage receives individual primitives as its input from the pipeline. The primi-
tive data consists of the vertices that define its geometric shape. Each vertex must, at a
minimum, contain one attribute with the SV_Position system value semantic. This is a
four-component homogeneous coordinate that represents the position of the vertex in clip
space. Before moving on to consider the individual operations that the rasterizer performs
on these input primitives, we will take a short excursion to clarify what clip space is, and
how geometry is transformed into this coordinate space. Perhaps more importantly, we
will consider the properties of this coordinate space, and how it is used in the context of
rasterizing a scene.
Clip Space and Normalized Device Coordinates
The term clip space refers to a post-projection coordinate space that can be used to identify
what portion of a scene will be visible under the current viewing conditions. This space
is essentially a result of the current projection transformation, which is typically either a
perspective or orthographic projection. We are primarily concerned with perspective pro-
jections, and will focus on them throughout this section. However, many of the same con-
cepts apply to orthographic projections as well, so the following discussion is valid in both
cases. 2 4
We mentioned above that the position data supplied in the SV_Position system value
semantic are homogeneous coordinates consisting of four components. In general, the first
three components of this position specify the X, Y, and Z coordinates of the vertex in the
3D space in which it currently resides. The fourth component, which is referred to as the W
coordinate, always has a value of 1 before a projection transformation is applied to it. Thus,
the position coordinates are always in a form such as [X,Y,Z,\]. After a projection trans-
form is applied to these points, the resulting form will depend on the type of projection that
was performed. If a perspective projection is used, the resulting point produces a W -value
that is equal to the Z-component prior to the projection 2 5
while the Z component is a scaled
version of itself, based on the projection transformations' near and far clipping planes.
Equations (3.2) and (3.3) show the results of the projection transformation on an input Z
(and W) component based on the projection matrix shown in Equation (8.7). Here we as-
sume that the input coordinates are denoted by the subscript 1, and that the post-projection
2 4
A general discussion of the various transformations that a set of geometry pass through is provided in Chapter 8,
"Mesh Rendering." This includes a discussion of the perspective projection.
2 5
This assumes that the projection matrix used is the same as described in the DXSDK documentation, and also
as described in Chapter 8.
Search WWH ::




Custom Search