Game Engine Architecture

(Ben Green) #1
411

direction of the surface normal at various points on the surface. They also
encompass a description of how light should interact with the surface. This
includes diff use color, shininess/refl ectivity, roughness or texture, degree of
opacity or transparency, index of refraction, and other optical properties. Sur-
face properties might also include a specifi cation of how the surface should
change over time (e.g., how an animated character’s skin should track the
joints of its skeleton or how the surface of a body of water should move).
The key to rendering photorealistic images is properly accounting for
light’s behavior as it interacts with the objects in the scene. Hence rendering
engineers need to have a good understanding of how light works, how it is
transported through an environment, and how the virtual camera “senses” it
and translates it into the colors stored in the pixels on-screen.


10.1.2.1. Introduction to Light and Color


Light is electromagnetic radiation; it acts like both a wave and a particle in
diff erent situations. The color of light is determined by its intensity I and its
wavelength λ (or its frequency f, where f = 1/λ). The visible gamut ranges from
a wavelength of 740 nm (or a frequency of 430 THz) to a wavelength of 380 nm
(750 THz). A beam of light may contain a single pure wavelength (i.e., the
colors of the rainbow, also known as the spectral colors ), or it may contain a
mixture of various wavelengths. We can draw a graph showing how much of
each frequency a given beam of light contains, called a spectral plot. White light
contains a litt le bit of all wavelengths, so its spectral plot would look roughly
like a box extending across the entire visible band. Pure green light contains
only one wavelength, so its spectral plot would look like a single infi nitesi-
mally narrow spike at about 570 THz.


Light-Object Interactions


Light can have many complex interactions with matt er. Its behavior is gov-
erned in part by the medium through which it is traveling and in part by the
shape and properties of the interfaces between diff erent types of media (air-
solid, air-water, water-glass, etc.). Technically speaking, a surface is really just
an interface between two diff erent types of media.
Despite all of its complexity, light can really only do four things:
z It can be absorbed ;
z It can be refl ected ;
z It can be transmitt ed through an object, usually being refracted (bent) in
the process;
z It can be diff racted when passing through very narrow openings.


10.1. Foundations of Depth-Buffered Triangle Rasterization

Free download pdf