i
i
i
i
i
i
i
i
2 6
2 6
Naty Hoffman
Computer Graphics in Games
Of all the applications of computer graphics, computer and video games attract
perhaps the most attention. The graphics methods selected for a given game have
a profound effect, not only on the game engine code, but also on the art asset
creation, and even sometimes on the gameplay, or core game mechanics.
Although game graphics rely on the material in all of the preceding chapters,
two chapters are particularly germane. Games need to make highly efcient use of
graphics hardware, so an understandingof the material in Chapter 18 is important.
Of course, games are interactive applications, and, as such, many of the principles
detailed in Chapter 19 apply.
In this chapter, I will detail the specic considerations that apply to graph-
ics in game development, from the platforms on which games run to the game
production process.
26.1 Platforms
Here, I use the term platform to refer to a specic combination of hardware, op-
erating system, and API (application programming interface) for which a game
is designed. Games run on a large variety of platforms, ranging from virtual
machines used for browser-based games to dedicated game consoles using spe-
cialized hardware and APIs.
In the past, it was common for games to be designed for a single platform.
The increasing cost of game development has made this rare; multiplatform game
653
i
i
i
i
i
i
i
i
654 26. Computer Graphics in Games
development is now the norm. The incremental increase in development cost to
support multiple platforms is more than repaid by a potential doubling or tripling
of the customer base.
Some platforms are quite loosely dened. For example, when developing a
game for the Windows PC platform, the developer must account for a very large
variety of possible hardware congurations. Games are even expected to run (and
run well) on PC congurations that did not exist when the game was developed!
This is only possible due to the abstractions afforded by the APIs dening the
Windows platform.
One way in which developers account for wide variance in graphics perfor-
mance is by scaling—adjusting graphics quality in response to system capabil-
ities. This can ensure reasonable performance on low-end systems, while still
achieving competitive visuals on high-performance systems. This adjustment is
sometimes done automatically by proling the system performance, but more of-
ten this control is left in the hands of the user, who can best judge his personal
preferences for quality versus speed. Display resolution is easiest to adjust, fol-
lowed by antialiasing quality. It is also fairly common to offer several quality
levels for visual effects such as shadows and motion blur, including the option of
turning the effect off entirely.
Differences in graphics performance can be so large that some machines may
not run the game at a playable frame rate, even with the lowest quality settings;
for this reason PC game developers publish minimum and recommended machine
specications for each game.
As platforms, game consoles are strictly dened. When developing a game
for, e.g., Nintendo’s Wii console, the developer knows exactly what hardware the
game will run on. If the platform’s hardware implementation is changed (often
done to reduce manufacturing costs), the console manufacturer must ensure that
the new implementation behaves exactly like the previous one, including timing
and performance. This is not to say that the console developer’s task is easy; con-
sole APIs tend to be much less abstract and closer to the underlying hardware.
This gives console development its own set of difculties. In some sense, mul-
tiplatform development (which commonly includes at least two different console
platforms and often Windows as well) is the hardest of all, since the multiplatform
game developer has neither the assurance of a xed platform or the convenience
of a single high-level API.
Browser-based virtual machines such as Adobe Flash are an interesting class
of game platforms. Although such virtual machines run on a wide class of hard-
ware from personal computers to mobile phones, the high degree of abstraction
provided by the virtual machine results in a stable and unied development plat-

Get Fundamentals of Computer Graphics, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.