Graphics Reference
In-Depth Information
Application
Vertex generation (VG)
Vertex data
Vertex processing (VP)
Global data
Primitive generation (PG)
Vertex topology
Primitive processing (PP)
Memory
Fragment generation (FG)
Fragment processing (FP)
Texture images
Pixel operations (PO)
Output image
Figure 38.3: Graphics pipeline. This matches both Direct3D and OpenGL at this level of
detail. Arrows indicate data flow while drawing.
interface. Instead, we develop a simplified pipeline model that matches both archi-
tectures at the chosen level of detail. Figure 38.3 is a block diagram of this
architecture.
As you've seen in earlier chapters, graphics architectures perform operations
on aggregate data types—vertices, primitives (e.g., triangles), pixel fragments
(often just fragments ), and pixels—and on multidimensional arrays of pixels
(e.g., 2D images and 1D, 2D, and 3D textures). Pixels in a texture are called tex-
els. Operations are performed in the fixed sequence illustrated in Figure 38.3. The
sequence cannot generally be modified by the application, although some stages
(e.g., primitive processing) may be omitted.
We briefly review the operation of the graphics pipeline by considering the
processing of a single triangle (see Figure 38.3, left column). Prompted by the
application, the vertex generation stage creates three vertices from geometric and
attribute data (e.g., coordinates and color) stored in memory. The vertices are
passed to the vertex processing stage, where operations such as coordinate-space
transformations are performed, resulting in homogeneous clip-coordinate vertices.
The primitive generation stage assembles the clip-coordinate vertices into a single
triangle, possibly accessing topology information in memory to do so. The trian-
gle is passed to the primitive processing stage, where it may be culled, replaced by
a finite set of related primitives (e.g., subdivided into four smaller triangles), or left
unchanged. After reaching the fragment generation stage, the triangle is clipped
against the viewing-frustum boundaries, projected to screen coordinates, then ras-
terized such that a fragment (a piece of geometry so small that it contributes to
only a single pixel) is generated for each pixel in the output image that geometri-
cally intersects the triangle. The fragment processing stage colors each fragment
by performing lighting calculations and accessing texture images. Finally, the col-
ored fragment is merged into the corresponding pixel in the output image. Oper-
ations performed in the pixel operation stage, such as z -comparisons and simple
 
 
Search WWH ::




Custom Search