Game Development Reference
In-Depth Information
Primitive setup. This is the process of creating the polygons from the vertex
information. This involves connecting the vertices together according to the
OpenGL states. Games most commonly use triangles or triangle strips as
their primitives.
Rasterization. This is the process of converting the polygons to pixels (also
called fragments).
Pixel processing. Pixel processing may also be referred to as fragment pro-
cessing. The pixels are tested to determine if they will be drawn to the frame
buffer at this stage.
Frame buffer. The frame buffer is a piece of memory that represents what
will be displayed to the screen for this particular frame. Blend settings de-
cide how the pixels will be blended with what has already been drawn.
In the last few years, the pipeline has become programmable. Programs can be
uploaded to the graphics card and replace the default stages of the fixed function
pipeline. You have probably heard of shaders; this is the name for the small
programs that overwrite certain parts of the pipeline.
Figure 2.4 shows the stages of the programmable pipeline. Transform and light-
ing has been removed; instead, there are vertex and geometry shaders. The pixel
processing stage has also become programmable, as a pixel shader. The vertex
shader will be run on every vertex that passes through the pipeline. Vertex sha-
ders cannot add vertices, but the properties such as position, color, and texture
coordinates can be modified.
Geometry shaders were added a little more recently than pixel and vertex shaders.
Geometry shaders take a whole primitive (such as a strip of lines, points, or triangles)
as input and the vertex shader is run on every primitive. Geometry shaders can create
new vertex information, points, lines, and even primitives. Geometry shaders are used
to create point sprites and dynamic tessellation, among other effects. Point sprites are
a way of quickly rendering a lot of sprites; it's a technique that is often used for particle
systems to create effects like fire and smoke. Dynamic tessellation is a way to add
more polygons to a piece of geometry. This can be used to increase the smoothness of
low polygon game models or add more detail as the camera zooms in on the model.
Pixel shaders are applied to each pixel that is sent to the frame buffer. Pixel
shaders are used to create bump mapping effects, specular highlights, and
per-pixel lighting. Bump map effects is a method to give a surface some extra
 
Search WWH ::




Custom Search