Game Development Reference
In-Depth Information
image (sometimes called a gobo) and also for shadow mapping to determine
whether a light can “see” a given point.
Another space that has become very important is tangent space, which
is a local space on the surface of an object. One basis vector is the sur-
face normal and the other two basis vectors are locally tangent to the
surface, essentially establishing a 2D coordinate space that is “flat” on
the surface at that spot. There are many different ways we could deter-
mine these basis vectors, but by far the most common reason to establish
such a coordinate space is for bump mapping and related techniques. A
more complete discussion of tangent space will need to wait until after we
discuss texture mapping in Section 10.5, so we'll come back to this sub-
ject in Section 10.9.1. Tangent space is also sometimes called surface-local
space.
10.4
Polygon Meshes
To render a scene, we need a mathematical description of the geometry in
that scene. Several different methods are available to us. This section fo-
cuses on the one most important for real-time rendering: the triangle mesh.
But first, let's mention a few alternatives to get some context. Construc-
tive solid geometry (CSG) is a system for describing an object's shape using
Boolean operators (union, intersection, subtraction) on primitives. Within
video games, CSG can be especially useful for rapid prototyping tools, with
the Unreal engine being a notable example. Another technique that works
by modeling volumes rather than their surfaces is metaballs, sometimes used
to model organic shapes and fluids, as was discussed in Section 9.1. CSG,
metaballs, and other volumetric descriptions are very useful in particular
realms, but for rendering (especially real-time rendering) we are interested
in a description of the surface of the object, and seldom need to determine
whether a given point is inside or outside this surface. Indeed, the surface
need not be closed or even define a coherent volume.
The most common surface description is the polygon mesh, of which
you are probably already aware. In certain circumstances, it's useful to
allow the polygons that form the surface of the object to have an arbi-
trary number of vertices; this is often the case in importing and editing
tools. For real-time rendering, however, modern hardware is optimized for
triangle meshes, which are polygon meshes in which every polygon is a tri-
angle. Any given polygon mesh can be converted into an equivalent triangle
mesh by decomposing each polygon into triangles individually, as was dis-
cussed briefly in Section 9.7.3. Please note that many important concepts
introduced in the context of a single triangle or polygon were covered in
 
Search WWH ::




Custom Search