1

The Fixed-Function

Graphics Pipeline

1

In your rst course in computer graphics, you probably used a graphics API

to help you create your projects. Because this book focuses on graphics using

OpenGL, we assume that your API was OpenGL, and in this chapter we

review the graphics pipeline as it is expressed in OpenGL versions 1.x. If you

used a dierent API, especially in a rst graphics course, your experience was

probably very close to the OpenGL approach. These APIs used a xed-function

pipeline, or a pipeline with a xed set of operations on vertices and fragments.

In the rest of this book, we will look at the shader capabilities of OpenGL ver-

sions 2.x and how you can use them to create eects that are dicult or impos-

sible with the xed-function pipeline.

2

1. The Fixed-Function Graphics Pipeline

The Traditional View

When you develop a graphics application with the OpenGL API, you dene

geometry, viewing, projection, and a number of appearance properties.

Objects’ geometries are dened by their vertices, their normals, and their

graphics primitives, specied by

glBegin-glEnd pairs that encompass points,

lines, geometry-compressed groups, or polygons. Viewing and projection are

each dened with a specic function. Appearance is specied by dening

color, shading, materials, and lighting, or texture mapping. This information

is all processed in a very straightforward way by the xed-function OpenGL

system, acting either in software or in a graphics card.

The simplest way to view OpenGL’s operations is to think of it as using

two connected operations: a vertex-processing operation and a pixel-processing

operation. Each operation in xed-function OpenGL has a pre-determined set

of capabilities. It is important to understand how the geometry and appear-

ance directives you give are carried out in the pipelines. When you work with

shaders, though, it is more than important to understand the pipelines; your

shaders will actually take over part of these operations, so you absolutely must

understand them.

The Vertex Operation

To create the geometry of a scene, you specify primitives and vertices, and

operations that act on each vertex and create its pixel coordinates in screen

space. The primitive you specied then determines the pixels that must be

lled to represent it, and any appearance information you specied is used to

determine how those pixels are to be colored in the pixel-processing operation.

The geometry part of the vertex processing follows the ow in Figure 1.1. The

geometry processing is carried out for each vertex independently of any infor-

mation on grouping in your specied primitive; the grouping information is

only used after the vertices nish the vertex processing.

The rst stage of the vertex operation denes the fundamental geom-

etry of your scene. The input to this stage is the set of vertex denitions (your

glVertex*, glNormal*, and glTexCoord* function calls) and the grouping de-

nition (your

glBegin(...) and glEnd( ) function calls) that you set for the

scene. Each piece of geometry is created, or modeled, in its own model space.

This coordinate space can be anything that makes it easy for you to dene

the vertices and relationships for your model. Modeling functions include any

operations you may need to create these denitions and often use mathemati-

cal functions operating in the model space. As we noted, the geometry might

Start Free Trial

No credit card required