Download June/July 1995

Transcript
G R A P H I C S
Three-Dimensional Pixels
Pixels are generated for the frame buffer
by flat shading, Gouraud shading, or
texture mapping. Flat shading fills a
polygon with pixels that are all the same
color. Gouraud shading fills a polygon
with pixels that are computed using
color gradients. Texture mapping fills a
polygon with a two-dimensional bitmap
like a digital photograph.
Each of these methods has its merits. Flat shading is very fast, but it
doesn’t produce a very good simulation
of the real world. Gouraud shading produces a much better representation of a
real-world object, and it too is fairly
fast. Most three-dimensional graphics
hardware can produce almost exactly
the same performance with flat- or
Gouraud-shaded polygons. Texture
mapping produces very realistic effects,
but it is much slower than flat or
Gouraud shading.
The 3DO console and Doom use
texture mapping—in the case of the
game, the technique makes players feel
like they are in a real three-dimensional
environment. Unfortunately, for various
reasons, texture mapping is slow, and
poor quality texture mapping produces
a variety of nasty artifacts unacceptable
to players.
So, you can generate a threedimensional pixel using one of these
techniques or any combination of them.
Figure 2 shows a three-dimensional
pixel, which is the depth value and the
x, y location taken together. The z value
is stored into a z buffer. A z buffer is a
large chunk of memory dedicated to
saving the last z or depth value for a
particular x, y location in the display.
For every pixel in the display, there is a
z or depth value. For a 1,280-by-1,024
display, there exist 1,310,720 pixels in
the frame buffer and the same number
of depth values. The biggest problem
with a z buffer is that it increases the
amount of memory on the display subsystem, and this cost is passed onto the
consumer by a price increase.
What’s in a Benchmark?
Traditionally, benchmarks comprised
small applications that measure the per-
38
GAME DEVELOPER • JUNE/JULY 1995
B E N C H M A R K S
Figure 2. 3D Pixels Plus Frame Buffer and Z Buffer
Z Buffer
or Depth
Memory
Frame Buffer Memory
formance of a machine. Dhrystones and
Whetstones are perfect examples of
this. These benchmarks contain a variety of application-like programs that
run in a certain period of time on a particular platform.
The time it takes to execute these
programs on a particular platform is
measured and can be compared on a
relatively fair basis to the time it takes
to execute them on another platform.
Usually, the time measured is used to
compute a standard unit number. The
industry as a whole looks over the programs in the benchmark and decides in
some sense what is fair and what is not
fair.
A similar concept exists in the current PC graphics benchmark area.
Benchmarks execute a series of graphics
instructions using a standard application programmer interface (API) like
the graphics device interface (GDI) in
Windows. The time it takes to perform
the operation is measured. The measured time is used to determine how
many operations the platform can do
per second. So, numbers like 40 million
lines per second for a benchmark that
measures line rendering using GDI are
reasonable.
Some benchmarks execute real
applications in a scripted environment
resulting in a time measurement. These
benchmarks often produce a single
magical number that can be used for
comparison.
Benchmarks are not perfect. They
don’t actually measure what a particular
user is doing on a particular day.
Instead, benchmarks use a standard
selection of operations that are supposed to represent the core activity of
the average user. Thus, the goal of a
benchmark is to reduce the potentially
infinite combination of operations
(CPU instructions or graphics primitives) down into a subset that represents
a reasonable cross-section of application
or user activities. Presumably, the representation of user activity is fair across
the variety of platforms available.
In the workstation arena, the
three-dimensional benchmark is
Graphics Performance Criteria (GPC).
It took 10 years and hundreds of engineers to implement this benchmark.
The result is a magic number that you
can easily translate into frames per second. GPC is essentially an application
environment with database traversal,
lighting, clipping, and rendering. On
PC platforms there exists a large number of GPC-style applications—that is,
games. Most of the games in the PC
already output frames per second. A
perfect example of this is Domark’s
Flight Simulator Toolkit, which lets the
user display the performance levels
while the game is running.