9

Modeling Global Illum ination with R adiosity 53
Left: Specular reflection
Right: Diffuse reflection
The way in which the photons are reflected from a
surface depends primarily on the smoothness of
the surface. Rough surfaces tend to reflect photons
in all directions. These are known as diffuse
surfaces, and this ty pe of reflection is know n as
diffusereflection(shownabove).Awallpainted
w ith flat pa int is a good example of a diffuse
surface.
The final illumination of the kitchen is determined
by the interaction between the sur faces and the
billions of photons emitted from the light source.
At any given point on a surface, it is possible that
photons have arrived directly from the light source
(direct illumination) or else ind irectly through
one or more bounces off other surfaces (indirect
illumination). If you were standing in the kitchen,
a very small number of the photons in the room
would enter your eye and stimulate the rods and
cones of your retina. This stimulation would, in
effect, form an image that is perceived by your
brain.
In computer gr aphics we replace the rods and
conesofaretinawiththepixelsofthecomputer
screen. One goal of a global illumination algorithm
is to re-create, as accurately as possible, what
you would see if you were standing in a real
environment. A second goal is to accomplish this
task as quickly as possible, ideally in real t ime (30
images per second). Currently, no single global
illumination a lgorithm can accomplish both goals.
Ray-Tracing
One of the first global illumination algorithms
developed is known as ray-tracing. The ray-tracing
algorithmrecognizesthatalthoughbillionsof
photons may be traveling about the room, the
photons we primarily care about are the ones that
enter the eye. The algorithm works by tracing
rays backward, from each pixel on the screen into
the 3D model. In this way, we compute only the
information needed to construct the image. To
create an image using ray-tracing, the following
procedure is performed for each pixel on the
computer screen.
1. A ray is traced back from the eye position,
through the pixel on the monitor, until
it intersects with a surface. We know the
reflectivity of the surface from the material
description,butwedonotyetknowtheamount
of light reaching that surface.
2. To determine the total illumination, we trace a
ray from the point of intersection to each light
source in the environment (shadow ray). If the
ray to a light source is not blocked by another
object, the light contr ibution from that source
is used to calculate the color of the surface.
3. If an intersected surface is shiny or t ransparent,
we also have to determine what is seen in or
through the surface being processed. Steps 1
and2arerepeatedinthereflected(and,inthe
case of transparency, transmitted) direction
until another surface is encountered. The
color at the subsequent intersection point is
calculated and factored into the original point.
4. If the second surface is also reflective or
transparent, the ray-tracing process repeats,
and so on until a maximum number of