Game Development Reference
In-Depth Information
Chapter 9
Polygonal Techniques
This chapter discusses several techniques that involve the manipulation of polyg-
onal models. A 3D graphics engine often needs to create polygonal models in
real-time in addition to working with models that have been preprocessed in
some way. We begin this chapter with techniques pertaining to decal construction
and billboarding, operations usually performed on the fly. Subsequent sections
discuss preprocessing methods such as polygon reduction and triangulation,
which are normally performed by a tool that generates structures used for render-
ing at a later time.
9.1 Depth Value Offset
Many games need to render special effects such as scorch marks on a wall or
footprints on the ground that are not an original part of a scene, but are created
during gameplay. (A method for creating these is discussed in Section 9.2.) The-
se types of decorative additions are usually decaled onto an existing surface and
thus consist of polygons that are coplanar with other polygons in a scene. The
problem is that pixels rendered as part of one polygon rarely have exactly the
same interpolated depth value as pixels rendered as part of a coplanar polygon.
The result is an undesired pattern in which parts of the original surface show
through the decaled polygons.
The goal is to find a way to offset a polygon's depth in a scene without
changing its projected screen coordinates or altering its texture-mapping perspec-
tive. Most 3D graphics systems contain some kind of polygon offset function to
help achieve this goal. However, these solutions generally lack fine control and
usually incur a per-vertex performance cost. In this section, we present an alter-
native method that modifies the projection matrix to achieve the depth offset
Search Nedrilad ::

Custom Search