Game Engine Architecture

(Ben Green) #1

10.1. Foundations of Depth-Buffered Triangle Rasterization 401


provide the illusion of motion. This means a real-time rendering engine has at
most 33.3 ms to generate each image (to achieve a frame rate of 30 FPS). Usu-
ally much less time is available, because bandwidth is also consumed by other
engine systems like animation, AI, collision detection, physics simulation, au-
dio, player mechanics, and other gameplay logic. Considering that fi lm ren-
dering engines oft en take anywhere from many minutes to many hours to
render a single frame, the quality of real-time computer graphics these days
is truly astounding.


10.1.1. Describing a Scene


A real-world scene is composed of objects. Some objects are solid, like a brick,
and some are amorphous, like a cloud of smoke, but every object occupies a
volume of 3D space. An object might be opaque (in which case light cannot
pass through its volume), transparent (in which case light passes through it
without being scatt ered, so that we can see a reasonably clear image of what-
ever is behind the object), or translucent (meaning that light can pass through
the object but is scatt ered in all directions in the process, yielding only a blur
of colors that hint at the objects behind it).
Opaque objects can be rendered by considering only their surfaces. We
don’t need to know what’s inside an opaque object in order to render it, be-
cause light cannot penetrate its surface. When rendering a transparent or
translucent object, we really should model how light is refl ected, refracted,
scatt ered, and absorbed as it passes through the object’s volume. This requires
knowledge of the interior structure and properties of the object. However,
most game engines don’t go to all that trouble. They just render the surfaces


Virtual Screen
(Near Plane)

xC

zC

yC

Rendered
FrustumCamera Image

Camera

Figure 10.1. The high-level rendering approach used by virtually all 3D computer graphics
technologies.

Free download pdf