Graphics Reference
In-Depth Information
tive information, with the geometry representing a standard viewing space. All
depth information for later processing comes from the z -coordinates in this eye
space. The ModelView matrix is defined at this point, and is used to transform
the vertices for geometric computations, as well as to transform the values of
the normals, light positions, and light directions for lighting computations.
Once you are in eye space, other information comes into play. As part
of defining each vertex, you probably also provided some appearance infor-
mation (e.g., glColor3f ) or other information (e.g., lights or materials). This
information can be used here to set the vertex color. The color of each vertex
can be set as your color statements are implemented or any lighting operations
you specified are carried out. If lighting is enabled, the light parameters, light
position and direction, normal vectors, and material specification are used to
determine a color for each vertex. Each vertex is assumed to have a color value
from this point on in the process.
The fourth stage of the vertex operation defines the clip space that is cre-
ated when you specify the projection of your scene to the viewplane. The input
to this stage is your projection definition, either perspective or orthographic.
This projection definition defines a projection transformation that is to be
applied to the eye space. Your projection definition creates a view volume , and
the projection transformation is applied to this view volume to create a rectan-
gular 3D space that can easily be used for the next stage.
The final stage of the vertex operation uses your specified viewport infor-
mation to create pixel-space representations for each vertex in screen space.
There are two primary operations here. One is clipping the geometry you spec-
ified on the clip space boundaries in your projection definition; if any clipping
is done, it may create new or modified primitives as vertex pixels are added or
deleted. When there is clipping, the new vertex pixels will need to have their
new colors or texture coordinates interpolated in the same way as edges are
interpolated in the rendering process. The second is converting the 3D clip
space coordinates into the 2D integer coordinates of the specified viewport.
This is a simple proportion operation in the x - and y -coordinates plus homoge-
neous division, followed by a truncation of these real values to integers. At the
same time, the z -coordinates are converted to depth values (usually integers)
that can be used in rendering. The output of this stage, and thus the output of
the entire vertex pipeline, is a set of vertices in integer pixel x - and y -coordi-
nates with grouping, normals, depth, texture coordinates, and color.
While Figure 1.1 describes the actions of the vertex pipeline, it can also
be useful to see the effects of these actions. In Figure 1.2 we describe this by
showing how the overall graphics pipeline works on a simple triangle rep-
resented by the three (blue) vertices. These are sent to the vertex pipeline by
Search WWH ::




Custom Search