Game Development Reference
In-Depth Information
Our description is of the conceptual flow of data through the graphics
pipeline. In practice, tasks are often performed in parallel or out of
sequence for performance reasons.
We are interested in real-time rendering systems which, at the time of
this writing, are primarily geared for rendering triangle meshes. Other
means of producing an image, such as raytracing, have a very different
high-level structure than that discussed here. A reader is warned
that in the future, techniques for real-time and o ine rendering could
converge if parallel raytracing becomes a more economical way to keep
up with the march of Moore's law.
With the above simplifications in mind, the following is a rough outline
of the flow of data through the graphics pipeline.
Setting up the scene. Before we can begin rendering, we must set
several options that apply to the entire scene. For example, we need
to set up the camera, or more specifically, pick a point of view in the
scene from which to render it, and choose where on the screen to ren-
der it. We discussed the math involved in this process in Section 10.2.
We also need to select lighting and fog options, and prepare the depth
buffer.
Visibility determination. Once we have a camera in place, we must
then decide which objects in the scene are visible. This is extremely
important for real-time rendering, since we don't want to waste time
rendering anything that isn't actually visible. This high-level culling
is very important for real games, but is usually ignored for simple
applications when you're getting started, and is not covered here.
Setting object-level rendering states. Once we know that an object is
potentially visible, it's time to actually draw the object. Each object
may have its own rendering options. We must install these options
into the rendering context before rendering any primitives associated
with the object. Perhaps the most basic property associated with an
object is a material that describes the surface properties of the object.
One of the most common material properties is the diffuse color of
the object, which is usually controlled by using a texture map, as we
discussed in Section 10.5.
Geometry generation/delivery. Next, the geometry is actually sub-
mitted to the rendering API. Typically, the data is delivered in the
form of triangles; either as individual triangles, or an indexed triangle
mesh, triangle strip, or some other form. At this stage, we may also
Search WWH ::




Custom Search