Game Development Reference
In-Depth Information
operations on triangle meshes require a more advanced data structure in
order to be implemented more e ciently. The basic problem is that the ad-
jacency between triangles is not expressed explicitly and must be extracted
by searching the triangle list. Other representation techniques exist that
make this information available in constant time. One idea is to maintain
an edge list explicitly. Each edge is defined by listing the two vertices on
the ends. We also maintain a list of triangles that share the edge. Then
the triangles can be viewed as a list of three edges rather than a list of
three vertices, so they are stored as three indices into the edge list rather
than the vertex list. An extension of this idea is known as the winged-edge
model [22], which also stores, for each vertex, a reference to one edge that
uses the vertex. The edges and triangles may be traversed intelligently to
quickly locate all edges and triangles that use the vertex.
10.4.2 Surface Normals
Surface normals are used for several different purposes in graphics; for
example, to compute proper lighting (Section 10.6), and for backface culling
(Section 10.10.5). In general, a surface normal is a unit 10 vector that is
perpendicular to a surface. We might be interested in the normal of a
given face, in which case the surface of interest is the plane that contains
the face. The surface normals for polygons can be computed easily by using
the techniques from Section 9.5.
Vertex-level normals are a bit trickier. First, it should be noted that,
strictly speaking, there is not a true surface normal at a vertex (or an edge
for that matter), since these locations mark discontinuities in the surface of
the polygon mesh. Rather, for rendering purposes, we typically interpret
a polygon mesh as an approximation to some smooth surface. So we don't
want a normal to the piecewise linear surface defined by the polygon mesh;
rather, we want (an approximation of) the surface normal of the smooth
surface.
The primary purpose of vertex normals is lighting. Practically every
lighting model takes a surface normal at the spot being lit as an input.
Indeed, the surface normal is part of the rendering equation itself (in the
Lambert factor), so it is always an input, even if the BRDF does not depend
on it. We have normals available only at the vertices, but yet we need to
compute lighting values over the entire surface. What to do? If hardware
resources permit (as they usually do nowadays), then we can approximate
the normal of the continuous surface corresponding to any point on a given
face by interpolating vertex normals and renormalizing the result. This
technique is illustrated in Figure 10.12, which shows a cross section of a
10 This is not strictly necessary in some cases, but in practice we almost always use
unit vectors.
 
Search WWH ::




Custom Search