Game Engine Architecture

(Ben Green) #1
409

optimizes vertex reuse within the cache. It generally takes into account factors
such as the size of the vertex cache(s) present on a particular type of GPU and
the algorithms used by the GPU to decide when to cache vertices and when
to discard them. For example, the vertex cache optimizer included in Sony’s
Edge geometry processing library can achieve rendering throughput that is up
to 4% bett er than what is possible with triangle stripping.


10.1.1.4. Model Space


The position vectors of a triangle mesh’s vertices are usually specifi ed relative
to a convenient local coordinate system called model space , local space, or object
space. The origin of model space is usually either in the center of the object or
at some other convenient location, like on the fl oor between the feet of a char-
acter or on the ground at the horizontal centroid of the wheels of a vehicle.
As we learned in Section 4.3.9.1, the sense of the model space axes is ar-
bitrary, but the axes typically align with the natural “front,” “left ” or “right,”
and “up” directions on the model. For a litt le mathematical rigor, we can de-
fi ne three unit vectors F, L (or R), and U and map them as desired onto the
unit basis vectors i, j, and k (and hence to the x-, y-, and z-axes, respectively)
in model space. For example, a common mapping is L = i, U = j, and F = k.
The mapping is completely arbitrary, but it’s important to be consistent for all
models across the entire engine. Figure 10.10 shows one possible mapping of
the model space axes for an aircraft model.


L= i

F= k

U= j

Figure 10.10. One possible mapping of the model space axes.


10.1.1.5. World Space and Mesh Instancing


Many individual meshes are composed into a complete scene by position-
ing and orienting them within a common coordinate system known as world
space. Any one mesh might appear many times in a scene—examples include
a street lined with identical lamp posts, a faceless mob of soldiers, or a swarm
of spiders att acking the player. We call each such object a mesh instance.


10.1. Foundations of Depth-Buffered Triangle Rasterization

Free download pdf