Game Development Reference
In-Depth Information
10.1
How Graphics Works
We begin our discussion of graphics by telling you how things really work,
or perhaps more accurately, how they really should work, if we had enough
knowledge and processing power to make things work the right way. The be-
ginner student is to be warned that much introductory material (especially
tutorials on the Internet) and API documentation suffers from a great lack
of perspective. You might get the impression from reading these sources
that diffuse maps, Blinn-Phong shading, and ambient occlusion are “The
way images in the real world work,” when in fact you are probably read-
ing a description of how one particular lighting model was implemented in
one particular language on one particular piece of hardware through one
particular API. Ultimately, any down-to-the-details tutorial must choose a
lighting model, language, platform, color representation, performance goals,
etc.—as we will have to do later in this chapter. (This lack of perspective
is usually purposeful and warranted.) However, we think it's important
to know which are the fundamental and timeless principles, and which are
arbitrary choices based on approximations and trade-offs, guided by tech-
nological limitations that might by applicable only to real-time rendering,
or are likely to change in the near future. So before we get too far into
the details of the particular type of rendering most useful for introductory
real-time graphics, we want to take our stab at describing how rendering
really works.
We also hasten to add that this discussion assumes that the goal is
photorealism, simulating how things work in nature. In fact, this is often
not the goal, and it certainly is never the only goal. Understanding how
nature works is a very important starting place, but artistic and practical
factors often dictate a different strategy than just simulating nature.
10.1.1
The Two Major Approaches to Rendering
We begin with the end in mind. The end goal of rendering is a bitmap,
or perhaps a sequence of bitmaps if we are producing an animation. You
almost certainly already know that a bitmap is a rectangular array of colors,
and each grid entry is known as pixel, which is short for “picture element.”
At the time we are producing the image, this bitmap is also known as the
frame buffer, and often there is additional post-processing or conversion
that happens when we copy the frame buffer to the final bitmap output.
How do we determine the color of each pixel? That is the fundamental
question of rendering. Like so many challenges in computer science, a great
place to start is by investigating how nature works.
We see light. The image that we perceive is the result of light that
bounces around the environment and finally enters the eye. This process is
 
Search WWH ::




Custom Search