Graphics Reference
In-Depth Information
Application
Texture
data
Polygon
data
Polygon
meshes
Graphics card
Fragments
Vertex
data
Polygon
mesh
vertices
Geometric
transfor-
mations
Rasterize
and light
Image
assembly
Display
View
Lighting
data
Figure 1.8: The graphics pipeline, version 1.
of one stage are pushed on to the next stage so that the first stage can begin pro-
cessing the next polygon immediately.
Figure 1.8 shows a simplified view of this pipeline: Data about the scene being
displayed enters at various points to produce output pixels.
For many purposes, the exact details of the pipeline do not matter; one can
regard the pipeline as a black box that transforms a geometric model of a scene
and produces a pixel-based perspective drawing of those polygons. (Parallel-
projection drawings are also possible, but we'll ignore these for the moment.)
On the other hand, some understanding of the nature of the processing is valuable,
especially in cases where efficiency is important. The details of the boxes in the
pipeline will be revealed throughout the topic.
Even with this simple black box you can write a great many useful programs,
ignoring all physical considerations and treating the transformation from model
to image as being defined by the black box rather than by physics (like the non-
quadratic light-intensity falloff mentioned above).
The past decade has, to some degree, made the pipeline shown above
obsolete. While graphics application programming interfaces (APIs) of the past
provided useful ways to adjust the parameters of each stage of the pipeline, this
fixed-function pipeline model is rapidly being superseded in many contexts.
Instead, the stages of the pipeline, and in some cases the entire pipeline, are being
replaced by programs called shaders. It's easy to write a small shader that mimics
what the fixed-function pipeline used to do, but modern shaders have grown
increasingly complex, and they do many things that were impossible to do on the
graphics card previously. Nonetheless, the fixed-function pipeline makes a good
conceptual framework onto which to add variations, which is how many shaders
are in fact created.
1.6.1 Texture Mapping and Approximation
One standard component of the black box is the texture map. With texture map-
ping, we take a polygon (or a collection of polygons) and assign a color to each
point via a lookup in a texture image; the technique is a little like applying a stencil
 
 
 
Search WWH ::




Custom Search