MaximumPC 2004 10

(Dariusz) #1
burden on your system’s videocard and
CPU. Let’s take a look at how stencil shad-
ows (sometimes called shadow volumes)
work so you can understand why drawing
them is so hardware intensive.
Check out the screenshot on the pre-
ceding page. The red cube represents
a light source. The area under the cube
should be lit, but there’s a platform
between the light and the floor. You know
the area under the platform will be shad-
owed, but how can you describe this in a
simple computer program? It’s easy. Think
of the light as being the apex of a pyramid
and the four edges of the platform’s top
as lines that intersect the pyramid’s four
walls. The area inside the pyramid will be
illuminated, except for the area beneath
the platform, which will be shadowed.
This is precisely how Doom 3 handles
shadows. In our pyramid example, the
engine actually draws an invisible polygon
where the shadow appears. The engine
draws shadows on any object that enters
the invisible volume polygon. The trick is
that Doom 3 draws these invisible shadow
volumes for every light source and every
object in the game. Even with just two or
three light sources, the number of invisible
polygons quickly gets out of hand—they
may be invisible, but they still consume
precious GPU resources. Considering that
everything from the swinging light to the
muzzle blast of your shotgun is a light
source , that’s a lot to draw.

Do I Look Normal to You?
Dynamic shadows don’t account for all of
Doom 3’s eye candy. Normal maps are also
used to add an extra level of detail to the
character models and lots of the game’s sur-
faces. Here’s how they work.
Bump maps have been used in games
for a long time now. They’re nothing more
than simple grayscale textures that encode
the height of each pixel on the texture. When

applied to an otherwise flat surface, they
convey the illusion of depth. However, bump
maps have a problem. Because they only
modify the height of a flat surface and don’t
actually modify the geometry of the sur-
face, collision and clipping problems occur
when you use bump maps on polygons that
move—like the polys in a human face.
The solution to this problem is the
normal map, which contains not only the
height of each individual pixel on the base
surface, but also encodes the direction
that each pixel is facing. With this informa-
tion, a modern GPU can actually draw the
model with the extra polygons described
by the normal map, and clipping and poly-
gon collision are no longer a problem.
Game designers can create a model with

millions of polygons, then run it through a
filter in their 3D modeling software that will
convert the high-poly model to a low-poly
model and a normal map. In Doom 3, nor-
mal maps and 6,000 poly models are used
to draw monsters that appear to have all the
complexity of the high-res originals!

Oh Shaders, How I Love Thee!
The final stroke in the Carmackian trifecta of
3D engine design are the dozens of little
shader effects strewn liberally throughout
the game. The shockwave effect that occurs
near a rocket or grenade explosion, the
shimmer of heat around steamy pipes, and
the melting-away that claims so many corps-
es are all created with simple pixel and ver-

VIDEOCARD TESTS


GeForce 6800 Ultra (1280x1024 HQ) 81.1 fps
Radeon 9800 XT (1280x1024 HQ) 33.0 fps
GeForce4 Ti 4600 (800x600 MQ) 30.0 fps
GeForce4 MX 460 (640x480 LQ) 13.4 fps

As you can see, there’s a huge perfor-
mance difference between the old, fixed-
function GeForce4 MX card and the state-
of-the-art 6800 Ultra. Not only do you get
a massive performance increase, you also
run at a much higher quality level, with
high resolution textures and much more
nuanced shadows. The Radeon 9800 XT
performed well, but the eight-pipeline card
couldn’t keep up with the 16-pipe 6800.


CPU TESTS
Athlon FX-51 81.0 fps
Athlon XP 3200 64.4 fps
Pentium 4 2.0GHz 33.4 fps

The results of the CPU tests are quite
surprising. The Athlon XP—an underper-
former by today’s standards—performs
admirably. It’s able to keep up with the
CPU-heavy physics and sound engines,
unlike the slow 2GHz Pentium 4 we tested.

SYSTEM TESTS
Athlon FX-51, GeForce 6800 Ultra 81.0 fps
Athlon XP 3200, Radeon 9800 Pro 256MB 48.8 fps
Pentium 4 2GHz, GeForce3 Ti 500 25.1 fps

What’s surprising is that the high-end
system is nearly twice as fast as the mid-
range rig. The lesson is one Maximum PC
has preached for years: New hardware
gives you a huge performance boost,
even compared with a system that’s only
about a year old.
This means that, in order to get the
most Doom 3 performance for your buck,
you should: upgrade your videocard first,
your CPU second, and your memory
third. You should also remember that
pairing an uber-powerful videocard with a
slow-ass CPU will limit your in-game per-
formance, although not as much as we
would have expected.

Ë

OCTOBER 2004 MA XIMUMPC 6


One clever advancement found in Doom 3 is interactive, in-game GUIs that are
similar to Flash animations. When you approach one, your weapon drops and
is replaced by a cursor that lets you punch in codes as if you were standing in
front of the terminal.
Free download pdf