Radiosity and Realistic Image PDF
Radiosity and Realistic Image PDF
Realistic Image
Synthesis
Michael F. Cohen
John R. Wallace
Except where credited to another source, the C and C++ Code may be used freely to
modify or create programs that are for personal use or commercial distribution.
ISBN 0-12-059756-X
About the cover image:
The cover image shows the interior of Le Corbusiers Chapel at Ronchamp,
France. The illumination was computed using radiosity, with the sunbeams added
by stochastic ray tracing during rendering [109, 110]. The model was created by
Paul Boudreau, Keith Howie, and Eric Haines at 3D/EYE, Inc. with Hewlett-
Packards ARTCore Radiosity and Ray Tracing library.
The image is a frame from the animation The Key is Light presented at the
Siggraph 91 Electronic Theater. The video was produced by Hewlett-Packard
Company TV, with extensive help from Becky Naqvi, John Fujii, and Ron Firooz
at Hewlett-Packard Company.
The back cover image is a radiosity rendering from a scene of Luthers Tavern
in the Opera Tales of Hoffman. The opera lighting design software used for this
image is part of a PhD dissertation by Julie OBrien Dorsey at Cornell Universitys
Program of Computer Graphics [73].
(c) (d)
(e) (f)
Plate 1. Six Renderings of Red-Blue Box (see Chapter 1). (a) Local, (b) Ray
Trace, (c) Radiosity, (d) Radiosity + Glossy, (e) Radiosity + Fog, (f) Monte Carlo.
Courtesy of Michael Cohen, Holly Rushmeier, and Ben Trumbore, Program of
Computer Graphics, Cornell University.
Plate 17. Constuctivist Museum. The complex interreflection from the ceiling
baffles was simulated with the progressive refinement approach. Courtesy of
Shenchang Chen, Stuart Feldman, and Julie OBrien Dorsey, Program of Com-
puter Graphics, Cornell University.
Plate 30. Radiosity from even Plate 31. Importance from even
further back. Courtesy of Brian further back. Courtesy of Brian
Smits, James Arvo, and David Smits, James Arvo, and David
Salesin, Program of Computer Salesin, Program of Computer
Graphics, Cornell University. Graphics, Cornell University.
Plate 37. Components of Plate 36. Direct Monte Carlo + Indirect Progressive
Refinement Radiosity + Light Ray Tracing. Courtesy of Shenchuang Chen,
Apple Computer Corporation.
Plate 39. Components of Plate 38. Direct + Indirect Monte Carlo + Light Ray
Tracing. Courtesy of Shenchuang Chen, Apple Computer Corporation.
Plate 51.
Gemldegalerie
BERLIN. Image
produced using the
COPHOS lighting design
software under develop-
ment at Zumtobel Licht
GmbH. Courtesy of
Zumtobel GmbH, Austria.
Preface xiii
1 Introduction 1
1.1 Realistic Image Synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 A Short Historical Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Raster Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Global Illumination Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3 Early Radiosity Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.4 The Rendering Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Radiosity and Finite Element Methods . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 The Radiosity Method and This Book . . . . . . . . . . . . . . . . . . . . . . . . 10
8 Meshing 209
8.1 Basic Subdivision Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
8.2 Mesh Template Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
8.2.1 Grid Superposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
8.2.2 Template Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
8.2.3 Multiblocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
8.2.4 Adaptive Subdivision with Templates . . . . . . . . . . . . . . . . . 214
8.3 Decomposition Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
8.3.1 Nodes-Elements-Together Decomposition . . . . . . . . . . . . . . 217
9 Rendering 243
9.1 Reconstructing the Radiosity Function . . . . . . . . . . . . . . . . . . . . . . 244
9.2 Interpolation Methods for Rendering . . . . . . . . . . . . . . . . . . . . . . . . 245
9.2.1 C0 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
9.2.2 C1 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
9.3 Two-Pass Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
9.3.1 Evaluating the Radiosity Equation per Pixel . . . . . . . . . . . . 259
9.3.2 Multi-Pass Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
9.4 Incorporating Surface Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
9.4.1 Texture Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
9.4.2 Bump Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
9.5 Mapping Radiosities to Pixel Colors . . . . . . . . . . . . . . . . . . . . . . . . 267
9.5.1 Gamma Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
9.5.2 Real-World Luminance to Pixel Luminance . . . . . . . . . . . . 268
9.6 Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
9.6.1 Human Vision and Color . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
9.6.2 Color Matching Functions and the CIE Chromaticity Di-
agram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.6.3 Color Spaces and Image Synthesis . . . . . . . . . . . . . . . . . . . . 280
9.6.4 Direct Use of Spectral Data . . . . . . . . . . . . . . . . . . . . . . . . . 283
9.7 Hardware Accelerated Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.7.1 Walkthroughs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.7.2 Hardware-Supported Texture Mapping . . . . . . . . . . . . . . . . 285
9.7.3 Visibility Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
10 Extensions 289
10.1 Nondiffuse Light Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
10.1.1 Form Factors to and from Light Sources . . . . . . . . . . . . . . . 290
Bibliography 349
Index 373
Donald P. Greenberg
Professor and Director
Program of Computer Graphics
Cornell University
context, the peculiarities of the human visual system are discussed, ranging
from the nonlinear response of the eye to luminance, to the tristimulus theory of
color perception. Chapter io then expands the scope of the radiosity methods by
lifting many of the restrictions assumed in the earlier discussion, such as diffuse
surfaces and non-participating media. Finally, the book concludes with a chapter
that explores a number of developing applications of the radiosity method, and
takes a moment to look towards the future.
The presentation in this book assumes a familiarity with the basic concepts
of computer graphics. There are a number of excellent computer graphics texts
that more fully explore some of the techniques that are called on in the algo-
rithms described here [84, 97, 173, 195, 258]. The discussion also assumes
an understanding of undergraduate calculus and linear algebra. Where more
advanced mathematical concepts are required, an effort is made to provide the
reader with enough background information to understand and appreciate the
material.
Acknowledgments
We thank the many colleagues who have directly and indirectly contributed
to the making of this book.
Without the dedication and persistent efforts of Prof. Donald P. Greenberg
of Cornell University, neither author would be in a position today to write this
text. His contributions to the development of the field of image synthesis are
well known. We thank him personally for inviting us into Cornells Program of
Computer Graphics where both authors were introduced to radiosity and image
synthesis, and for contributing the Foreword to this book.
Pat Hanrahan, beyond contributing a chapter to the book, is also largely
responsible for providing the first author with the stimulating environment at
Princeton University in which to work.
We would like to especially acknowledge the great efforts that went into
reviewing chapters of this book by Ken Chiu, Robert Cross, Brian Curless,
Stuart Feldman, Alain Fournier, John Fujii, Steven Gortler, Paul Lalonde, Marc
Levoy, Robert Lewis, Dani Lischinski, Earlin Lutz, Holly Rushmeier, David
Salesin, Peter Shirley, and Filippo Tampieri.
We thank Jutta Joesch for many hours of editing this text and for her enor-
mous help in gaining a better understanding of how to explain many of the more
difficult concepts presented. We would also like to thank Steven Gortler and
Peter Schrder for many discussions leading to much of the material on wavelets
in Chapter 7; Holly Rushmeier for numerous discussions that contributed ma-
terially to the content of this book; John Abel, Maged Tawfik, Paul Heckbert,
Mark Reichert, Seth Teller, David Munson, and Stuart Feldman for valuable
discussions; John Fujii for first pointing out the topological shadow test dis-
cussed in Chapter 8, and for many hours of enjoyable discussions of aesthetic
and philosophical questions; Tamar Cohen for creating models used in some of
the images; Emil Ghinger for the black and white photography; Kevin Stokker
for software used to compute the error images in Chapter 6; Kim Wagner for
help in obtaining the cover image; Eric Haines for providing the initial version
of the Bibliography; Brian Rosen for help in compiling the Bibliography.
The authors would like to acknowledge some of the many additional collabo-
rators through the past decade who have contributed to this work. These include
Daniel Baum, Philip Brock, Rikk Carey, Shenchang Chen, Lisa Desjarlais, Stu-
art Feldman, Cindy Goral, Kevin Koestner, David Immel, Peter Kochevar, Alan
Polinsky, David Salmon, Kenneth Torrance, Ben Trumbore, and many others
at Cornell University; Franois Sillion and Claude Puech at the Ecle Normale
Suprieure, James Painter, John Kawai, and Gershon Elber at the University of
Utah, Philipp Slusallek at Universitt Erlangen, and many current colleagues at
Princeton University.
We would like to thank Eric Haines and Kells Elmquist at 3D/EYE, Inc. for
many years of collaboration in the pursuit of realistic image synthesis, Samir
Hanna for providing the second author time to write this all down, and the many
other people at 3D/EYE, Inc. and Hewlett-Packard who have jointly participated
in the development of radiosity and rendering software.
Images were contributed by Daniel Baum, A. T. Campbell III, Julie 0Brien
Dorsey, Shenchang Chen, Stuart Feldman, Monika Fleischmann, Cindy Goral,
Eric Haines, Pat Hanrahan, Paul Heckbert, Keith Johnson, Dani Lischinski, Gary
Meyer, David Munson, Mark Reichert, Holly Rushmeier, Brian Smits, David
Salesin, Peter Shirley, Franois Sillion, Filippo Tampieri, Hewlett Packard, and
Zumtobel Licht GmbH.
To Jenifer Niles, our editor at Academic Press, thank you for guiding us
successfully through the process of creating an actual book.
Finally, the contribution of our wives, Jutta M. Joesch and Diane L. Wallace
cannot be understated. Without their patience and support we could not have
finished this.
Oh well, enough of these idle musings. They aint gonna feed me.
Id better get down to business.
Alan Cohen
from The Saga of Harry the Snake
Chapter 1
Introduction
In the pursuit of lifelike images, artists have long attempted to understand the
behavior of light and the characteristics of perception. Techniques that may
appear obvious, like perspective, were developed through painstaking study and
experimentation. The paintings of Vermeer and Rembrandt represent an under-
standing of illumination, color, and perception that evolved through centuries
of such experience. More recently, the Impressionists made a particular study
of the subtleties of light and shading; Renoir, for example, pointed out that
Shadows are not black; no shadow is black. It always has color.1
The connection between light and visual representation received its most
concrete realization with the invention of photography in the nineteenth century.
Because a photograph is the direct consequence of the physical propagation of
light, the camera is an invaluable recorder of things that exist. The creation of
realistic images of things that do not exist, or that are not normally perceivable
as images, such as scientific data, has remained until recently the domain of the
artist and illustrator.
Over the last few centuries physicists have developed mathematical models of
the processes by which light interacts with surfaces and propagates through an
environment. With the advent of the computer it has become practical to evaluate
such models on a large enough scale to simulate complex phenomena. Using
a computer, a model of light reflection and propagation can be evaluated for a
scene whose geometry and material properties have been specified numerically.
In effect, a photograph can be taken of a scene that does not exist in reality.
The ability to create images of nonexistent environments is important to ap-
plications ranging from industrial or architectural design to advertising and enter-
tainment. Phenomena not accessible to normal visual experience can also be vi-
1
The immediate source of this quotation, which comes close to reducing radiosity to a
sentence, is Parker et al. [179], who in turn quote from [193].
1.1.1 Goals
A clear understanding of the goal of image synthesis becomes increasingly im-
portant as algorithms and computational methods grow more sophisticated. In
addition to the evaluation of competing approaches, more intelligent algorithms
need a basis for deciding how to allocate computational effort and when to end
the computation, which requires knowing when the goal has been achieved.
Perhaps the most far reaching goal for image synthesis is the creation a
visual experience identical to that which would be experienced in viewing the
real environment. The diagram in Figure 1.1 shows a simple model of the
image synthesis process that provides a basis for discussing the issues involved
in reaching this goal.
In the real world, as shown in the top half of the diagram, light propagates
through the scene and eventually enters the eye with a particular directional
and wavelength distribution. The eye and the brain process this information at
increasingly higher levels of abstraction, leading ultimately to what is called the
visual experience.
The bottom half of the diagram shows the modifications to the process
required for image synthesis. Instead of the physical propagation of light, a
mathematical model is evaluated to produce the required distribution of light
energy. These results are then passed to a display device that physically realizes
the computed light distribution and sends it to the eye. Image synthesis thus
appears to require simply the exact reproduction of the distribution of light
energy entering the eye. Given this, the process of experiencing the image will
take care of itself.
1.1.2 Limitations
There are two problems with this apparently simple approach. First, the com-
putation in step one is arbitrarily expensive. For all practical purposes, there is
no end to the detail or accuracy with which reality might be simulated. How
Figure 1.1: The process of visual experience. The top half of the figure dia-
grams real-world experience; the bottom half displays visual experience based
on computer simulation.
The success of these early local illumination models and visibility algorithms
is attested to by the presence of their direct descendants in the microcode and
hardware of current graphics workstations. Such workstations are currently
capable of displaying on the order of one million shaded polygons per second.
In spite of the focus on interactive graphics, the ultimate attraction of realism
was not lost on early researchers. Appel [8] recognized that
Early steps toward solving these problems were taken with the develop-
ment of techniques like texture mapping and bump mapping [31, 32, 44], which
allowed the realistic representation of more complex surface properties. In ad-
dition, visible surface algorithms were applied to the problem of determining
shadows [13, 36, 67].
the shadows and the shadowed faces of the boxes. Color plate 1d is the result
of extensions that provide glossy reflection on the floor, while Color plate 1e
includes the effect of smoke within the environment.
More recent work has directly addressed the computational complexity of
radiosity algorithms. In 1988, Cohen et al. [59] introduced a progressive re-
finement approach that allows fast approximate solutions to be displayed. In
1991, Hanrahan et al. [116] formulated a complete hierarchical radiosity system
leading to a linear time algorithm. A great deal of work has also been devoted
to the critical step of discretizing or meshing the surfaces [21, 43, 154, 230]. An
important recent trend has been the incorporation of quantitative error estimates
into the solution process. Examples include estimates of integration error [19]
and the use of geometricand energy-based error metrics in the hierarchical
algorithm of Hanrahan et al. [116].
Eye
It was not until computers became more routinely available in the 1960s and
1970s that these methods became a common technique for engineering analysis.
Since then, there has been considerable research resulting in many working
finite element codes and in a better theoretical understanding of convergence
and other mathematical properties of such methods. In addition, a number of
excellent texts have also been written [23, 70, 273].
As Heckbert and Winget [125] point out, the heat transfer formulations
upon which radiosity is based can be viewed as simple finite element methods.
Heckbert and Winget emphasize the need for quantitative error metrics and show
that an explicit finite element approach considerably clarifies the understanding
of the accuracy of the approximation. Radiosity will be presented in this book
as a finite element method. However, this book cannot begin to do justice to
the broad field of finite element methods in general, and the reader is referred
to the above-mentioned texts for a wider theoretical background, as well as for
a wealth of practical information.
Figure 1.2: Diagram of the radiosity method indicating the chapters where con-
cepts are discussed.
In Chapter 10 techniques for extending the basic radiosity method are de-
scribed. These provide methods to handle more general global illumination
models, including general light sources, glossy and mirror reflection, and par-
ticipating media. With these more general approaches, the distinction between
ray tracing and radiosity will become less clear.
Chapter 11 concludes this book with a discussion of applications that are
already taking advantage of this technology. We also discuss current trends in
the development of radiosity methods.
Another way to look at the organization of the book is to relate it to the
flow of information in a generic radiosity algorithm. This view is provided by
the diagram in Figure 1.2.
Chapter 2
Rendering Concepts
by Pat Hanrahan
2.1 Motivation
The progress in rendering in the last few years has been driven by a deeper and
better understanding of the physics of materials and lighting. Physically based or
realistic rendering can be viewed as the problem of simulating the propagation
of light in an environment. In this view of rendering, there are sources that
emit light energy into the environment; there are materials that scatter, reflect,
refract, and absorb light; and there are cameras or retinas that record the quantity
of light in different places. Given a specification of a scene consisting of the
positions of objects, lights and the camera, as well as the shapes, material, and
optical properties of objects, a rendering algorithm computes the distribution of
light energy at various points in the simulated environment.
This model of rendering naturally leads to some questions, the answers to
which form the subjects of this chapter.
4. How does one formulate the conditions for the equilibrium flow of light
in an environment?
In this chapter these questions are answered from both a physical and a
mathematical point of view. Subsequent chapters will address specific represen-
tations, data structures, and algorithms for performing the required calculations
by computer.
observer moving the standard source until the brightnesses of the two sources
were equal. By recording the relative distances of the two light sources from
the eye, the relative brightnesses can be determined with the inverse square law.
Bouguer founded the field of photometry well before the mechanisms of
human vision were understood. It is now known that different spectra have
different brightnesses because the pigments in our photoreceptors have different
sensitivities or responses toward different wavelengths. A plot of the relative
sensitivity of the eye across the visible spectrum is shown in Figure 2.2; this
curve is called the spectral luminous relative efficiency curve. The observers
response, R, to a spectrum is then the sum, or integral, of the response to each
spectral band. This in turn is equal to the amount of energy at that wavelength,
l, times its relative luminosity.
770
R= V( )S( )d (2.1)
380 nm
where V is the relative efficiency and S is the spectral energy. Because there
is wide variation between peoples responses to different light sources, V has
been standardized.
Radiometry is more fundamental than photometry, in that photometric quan-
tities may be computed from spectroradiometric measurements. For this reason,
it is best to use radiometric quantities for computer graphics and image syn-
thesis. However, photometry preceded radiometry by over a hundred years, so
much of radiometry is merely a modern interpretation of ideas from photometry.
As mentioned, the radiometric units for power and energy are the watt and
joule, respectively. The photometric unit for luminous power is the lumen,
and the photometric unit for luminous energy is the talbot. Our eye is most
At the global level, the total power put into the system by the light sources
must equal the power being absorbed by the surfaces. In this situation
energy is being conserved. However, electrical energy is continuing to
flow into the system to power the lights, and heat energy is flowing out
of the system because the surfaces are heated.
At the local level, the energy flowing into a region of space or onto a
surface element must equal the energy flowing out. Accounting for all
changes in the flow of light locally requires that energy is conserved.
Thus, the amount of absorbed, reflected, and transmitted light must never
be greater than the amount of incident light. The distribution of light can
also become more concentrated or focused as it propagates. This leads to
the next topic which is how to characterize the flow of light.
is termed transport theory. The stuff can be mass, charge, energy, or light.
Flow quantities are differential quantities that can be difficult to appreciate and
manipulate comfortably. In this section all the important physical quantities
associated with the flow of light in the environment will be introduced along
with their application to computer graphics.
The easiest way to learn transport quantities is to think in terms of particles
(think of photons). Particles are easy to visualize, easy to count, and therefore
easy to track as they flow around the environment. The particle density p(x) is
the number of particles per unit volume at the point x (see Figure 2.3). Then
the total number of particles, P(x), in a small differential volume dV is
Note that the particle density is an intrinsic or differential quantity, whereas the
total number of particles is an absolute or extrinsic quantity.
r Now imagine a stream of particles all moving with the same velocity vector
v ; that is, if they are photons, not only are they all moving at the speed of
light, but they are all moving in the same direction. We wish to count the total
number of particles flowing across a small differential surface element dA in
a slice of time dt. The surface element is purely fictitious and introduced for
r
convenience and may or may not correspond to a real physical surface. In time
dt each particle moves a distance v dt. How many particles cross dA? This
can be computed using the following observation: r consider the tube formed by
v
sweeping dA a distance vdt in the direction . All particles that cross dA
between t and t + dt must have initially been inside this tube at time t. If they
were outside this tube, they would not be moving fast enough to make it to
the surface element dA in the allotted time. This implies that one can compute
the number of particles crossing the surface element by multiplying the particle
volume density times the volume of the tube. The volume of the tube is just
equal to its base (dA) times its height, which is equal to v cos dt. Therefore,
as depicted in Figure 2.4, the total number of particles crossing the surface is
P(x) = p(x) dV
= p(x)(v dt cos ) dA (2.3)
Radiosity and Realistic Image Synthesis 18
Edited by Michael F. Cohen and John R. Wallace
CHAPTER 2. RENDERING CONCEPTS
2.4. THE LIGHT FIELD
Note that the number of particles flowing through a surface element depends
on both the area of the surface element and its orientation relative to the flow.
Observe that the maximum flow through a surface of a fixed size occurs when
the surface is oriented perpendicular to the direction of flow. Conversely, no
particles flow across a surface when it is oriented parallel to the flow. More
specifically, the above formula says that the flow across a surface depends on the
cosine of the angle of incidence between the surface normal and the direction of
the flow. This fact follows strictly from the geometry of the situation and does
not depend on what is flowing.
The number of particles flowing is proportional both to the differential area
of the surface element and to the interval of time used to tally the particle count.
If either the area or the time interval is zero, the number of particles flowing
is also zero and not of much interest. However, we can divide through by the
time interval dt and the surface area dA and take the limit as these quantities
go to zero. This quantity is called the flux.
More generally all the particles through a point will not be flowing with
the same speed and in the same direction. Fortunately, the above calculation is
fairly easy to generalize to account for a distribution of particles with different
velocities moving in different directions. The particlerdensity is now a function
of two independent variables, position x and direction . Then, just as before, the
r
number of particles flowing across a differential surface element in the direction
equals r r
P(x, ) = p(x, ) cos d dA (2.4)
Here the notation d is introduced for the differential solid angle. The direction
of this vector is in the direction of the flow, rand its length is equal to the small
differential solid angle of directions about . For those unfamiliar with solid
angles and differential solid angles, please refer to the box.
least have not considered up to this point) the quantum nature of light. Instead,
when discussing light transport, the stuff that flows, or flux, is the radiant energy
per unit time, or radiant power , rather than the number of particles. The radiant
energy per unit volume is simply the photon volume density times the energy of
a single photon h c/, where h is Plancks constant and c is the speed of light.
The radiometric term for this quantity is radiance.
r r hc
L(x, ) = p(x, , ) d (2.6)
Radiance is arguably the most important quantity in image synthesis. Defined
precisely, radiance is power per unit projected area perpendicular to the ray per
unit solid angle in the direction of the ray (see Figure 2.5). The definition in
equation 2.6 is that proposed by Nicodemus [174], who was one of the first
authors to recognize its fundamental nature.
The radiance distribution completely characterizes the distribution of light
dA = (r d) (r sin d) = r2 sin d d
This derivation uses the definition of angle in radians: the angle subtended
by a circular arc of length l is equal to l/r. The circle itself subtends an
angle of 2 radians because the circumference of the circle is 2r. By using
a similar idea we can define a solid angle. The solid angle subtended by a
spherical area a is equal to a/r2. This quantity is the measure of the angle
in steradians (radians squared), denoted sr. A sphere has a total area of
4r2, so there are 4 steradians in a sphere.
A differential solid angle, indicated as d, is then
dA
d = = sin d d (2.5)
r2
It ris very convenient torthink of the differential solid angle as a vector,
d . The direction
r of d is in the direction of the point on the sphere, and
the length of d is equal to the size of the differential solid angle in that
direction.
Figure 2.5: The radiance is the power per unit projected area perpendicular to
the ray per unit solid angle in the direction of the ray.
Figure 2.6: Equality of flux leaving the first surface and flux arriving on the
second surface.
The total flux leaving the first surface must equal the flux arriving on the
second surface.
L1 d1 dA1 = L2 d2 dA2 (2.8)
but d1 = dA2/r2 and d2 = dA1/r2, thus,
dA1 dA2
T = d1 dA1 = d2 dA2 = (2.9)
r2
This quantity T is called the throughput of the beam; the larger the
throughput, the bigger the beam. This immediately leads to the conclusion
that
L1 = L2 (2.10)
To prove this law, consider the simple exposure meter in Figure 2.7. This
meter has a small sensor with area a and an aperture with area A. The
response of the sensor is proportional to the total integrated flux falling
on it.
R= A L cos d dA = LT (2.11)
Thus, assuming the radiance is constant in the field of view, the response
is proportional to the radiance. The constant of proportionality is the
throughput, which is only a function of the geometry of the sensor. The
fact that the radiance at the sensor is the same as the radiance at the surface
follows from the invariance of radiance along a ray.
This law has a fairly intuitive explanation. Each sensor element sees that
part of the environment inside the beam defined by the aperture and the
receptive area of the sensor. If a surface is far away from the sensor, the
sensor sees more of it. Paradoxically, one might conclude that the surface
appears brighter because more energy arrives on the sensor. However, the
sensor is also far from the surface, which means that the sensor subtends a
smaller angle with respect to the surface. The increase in energy resulting
from integrating over a larger surface area is exactly counterbalanced by
the decrease in percentage of light that makes it to the sensor. This
property of radiance explains why a large uniformly illuminated painted
wall appears equally bright over a wide range of viewing distances.
L cos d d
d =
i (2.12)
The irradiance, E, is the radiant energy per unit area falling on a surface
(the corresponding photometric quantity is the illuminance).
d
(2.13)
d
or
=
L cos d
(2.14)
The quantity cos dw is often referred to as the projected solid angle. It can be
thought of as the projection of a differential area on a sphere onto the base of
the sphere, as shown in Figure 2.8.
This geometric construction shows that the integral of the projected solid
angle over the hemisphere is just , the area of the base of a hemisphere with
unit radius. This result can also be derived directly by computing the following
integral:
2
cos d = 0 0 cos sin d d
2
= 0 0 cos d cos d
/2
cos 2
= 2
2
0
= (2.15)
Note that if all rays of light are parallel, which occurs if a single distant
source irradiates a surface, then the integral reduces to the simple formula
E = E0 cos (2.16)
where E0 is the energy per unit perpendicular area arriving from the distant
source.
B= Lo cos d (2.17)
Note that this use of intensity is very different from that typically used
by the computer graphics community. Even more confusion results because
intensity is often used to indicate radiance-like transport quantities in the physics
community. The radiant intensity is quite similar to that used in the geometric
optics community.
The energy distribution from a point light source expands outward from the
center. A small beam is defined by a differential solid angle in a given direction.
The flux in a small beam dw is defined to be equal to
r
d I ( ) d (2.18)
I is the radiant intensity of the point light source with units of power per unit
solid angle. The equivalent photometric quantity is the luminous intensity.
The radiant intensity in a given direction is equal to the irradiance at a
point on the unit sphere centered at the source. In the geometric optics literature
intensity is defined to be the power per unit area (rather than per unit solid angle).
In the case of a spherical wavefront emanating from a point source, the geometric
optics definition is basically the same as the radiometric definition. However,
in general, the wavefront emanating from a point source will be distorted after
it reflects or refracts from other surfaces and so the definition in terms of solid
angle, is less general.
For an isotropic point light source,
I = (2.19)
4
Of course, a point source may act like a spotlight and radiate different amounts
of light in different directions. The total energy emitted is then
r
= I ( ) d (2.20)
The irradiance on a differential surface due to a single point light source can
be computed by calculating the solid angle subtended by the surface element
from the point of view of the light source.
d cos
E = I = (2.21)
d 4 x x 2
S
where x x S is the distance from the point to the surface element. Note the
1/r2 fall-off: this is the origin of the inverse square law.
The distribution of irradiance on a surface is often drawn using a contour
plot or iso-lux diagram, while the directional distribution of the intensity from
a point light source is expressed with a goniometric or iso-candela diagram.2
This is a contour plot of equal candela levels as a function of the (,).
2
See Chapter 10 for details of lighting specifications.
3
A more complete treatment of color specification is given in Chapter 9.
The next question is how to characterize the reflection of light from a surface.
Reflection is defined as the process by which light incident on a surface leaves
that surface from the same side. Transmission, absorption, spectral and polariza-
tion effects, fluorescence, and phosphorescence are also important to consider in
developing an accurate model of the interaction of light with materials, but will
not be treated in detail here. Instead, this section will concentrate on nomencla-
ture and the general properties that are satisfied by all reflection functions.
Consider the lightr incident on a surface from a small differential solid angle
r
in the direction i. The amount of reflectedr light in another direction r is
proportional to the incident irradiance from i (see Figure 2.9). That is,
r r
dLr ( r ) dE ( i ) (2.22)
Equation 2.22 simply states that an increase in the incident light energy per unit
area results in a corresponding increase in the reflected light energy. The incident
irradiance can be increased by increasing either the solid angle subtended by the
source or the energy density in the beam.
The constant of proportionality is termed the bidirectional reflection distri-
bution function, or BRDF.
r
r r Lr ( r )
f r ( i r ) r (2.23)
Li ( i ) cos i d i
Radiosity and Realistic Image Synthesis 28
Edited by Michael F. Cohen and John R. Wallace
CHAPTER 2. RENDERING CONCEPTS
2.5. REFLECTION FUNCTIONS
More precisely,r the BRDF is defined to be the ratio of the reflected radiance in
the direction r to the differential irradiance from the incident direction i that
produces it. The BRDF is bidirectional because it depends on two directions.
Often, the dependence on the four angles is made explicit by writing the BRDF
as fr(i , i ; r , r ). The BRDF is a distribution function because it is strictly
positive. Since it gives the concentration of flux per steradian, it may take on
any value between zero and infinity. The BRDF has units of inverse steradians.
The BRDF has several interesting properties:
2. The BRDF is, in general, anisotropic. That is, if the incident and reflected
directions are fixed and the underlying surface is rotated about the surface
normal, the percentage of light reflected may change (see Figure 2.11).
Examples of anisotropic materials are brushed aluminum or cloth [134].
Many materials, however, are smooth and their reflectivity does not depend
on the surfaces orientation. Thus, their reflection functions do not change
if the surface is rotated, and
fr ((i , i + ) (r , r + )) = fr ((i , i) (r , r)) (2.25)
This implies that the reflection function has only three degrees of freedom
instead of four.
Figure 2.11: The reflection may change with rotations of the surface due to
anisotropy.
Notice that adding light from another incident direction has no influence
on the amount of light reflected from other incident directions. Thus, reflection
behaves linearly, and hence the total amount of light reflected by a surface in a
specific direction is given by a hemispherical integral over all possible incident
directions. This leads to the reflectance equation:
r r r r
Lr ( r ) = i
f r ( i r ) Li ( i ) cos i d i (2.26)
Put another way, the reflected radiance in a particular direction is due to the
radiance arriving from all directions weighted by the BRDF relating the incoming,
and reflected directions and by the projected solid angle.
r = i
r = i (2.27)
Lr (r , r ) = Li (r , r ) (2.28)
This physical fact can be mathematically expressed with a BRDF involving delta
functions.
(cos i cos r )
f r ,m = ( i ( r )) (2.29)
cos i
Recall that the delta function has the following three properties:
1. (x) = 0 if x 0
2.
(x) dx = 1
3.
(x y) f (x)dx = f ( y)
It can be verified that this leads to the correct reflected radiance by performing
the hemispherical integral.
(cos i cos r )
Lr ( r , r ) = ( i ( r ))
i cos i
Li ( i , i ) cos i d i d i (2.30)
= L (r , r )
i
The reflectance involves a double integral over the incident and reflected
directions for which the limits of integration have not yet been set. Three
choices for the limits are a differential solid angle, a finite solid angle, or the
entire hemisphere. Since this choice can be made for both the incident and the
reflected directions, there are nine different reflectances. These are shown in
table 2.2.
2
(i r) ( r )
i ( 2 )
i
(i r) (i r) (i 2)
2 (2 r) (2 r) (2 2)
The fact that energy is conserved can be ensured by forcing the hemispherical-
hemispherical reflectance to be less than 1.
r
r,d Lr,d ( r ) cos r d r
d (2 2 ) = = r
r
i i Li ( i ) cos i d i
Lr,d cos r d r
= r
E
Lr,d
=
E
= f r,d (2.34)
It thus immediately follows that if the BRDF is a constant, then the reflectance is
also a constant. More importantly, this relationship can be used to parameterize
the BRDF in terms of the reflectance: fr,d = d / . Often, it is more intuitive
to describe materials using their reflectances because they are constrained to lie
between 0 and 1. Whenever a is used in this text, it can safely be assumed to
lie between 0 and 1.
Since the outgoing radiance is constant, the radiosity
B = Lr,d (2.35)
is related to the irradiance by the following equation:
B
d = (2.36)
E
Equation 2.36 states that for diffuse reflection, the reflectance is equal to the
radiosity divided by the irradiance.
Figure 2.13: Complex reflection distributions arise from rough surface and sub-
surface phenomena.
are not planar and perfectly smooth and thus would not be expected to reflect
light in just one direction. A real BRDF will thus contain a component between
these limiting cases in which light hitting the surface from a certain direction is
reflected into a complex distribution of outgoing directions.
The terminology for the various components is highly variable in the image
synthesis literature. In particular, the intermediate component that we call glossy
reflection is variously called specular, rough specular, wide and narrow diffuse,
and directional diffuse. The term glossy has also been used in the surface reflec-
tion literature and has been selected instead for this work because its common
usage is suggestive of the intended technical meaning.
Lord Rayleigh was the first to explain the effects of surface finish on the
DGF
fr = (2.37)
4 cos r cos i
D(H, N, ) = (N H) (2.38)
model. Shadows can be added by testing whether a point on the surface is visible
to the light source. This is what is done in a ray tracer, but it requires access
to the entire environment and is therefore an example of a global illumination
model.
The second and considerably more difficult case is indirect illumination. In
this case light may come from any surface in the environment, and it is very
important to consider shadowing.
In the following sections, the interreflection of light between surfaces will
be taken into account, and the rendering equation is derived from the reflectance
equation. The radiosity equation, a simplified form of the rendering equation,
that results by assuming all surfaces are Lambertian reflectors is also derived.
Recall also that the irradiance from a single point light source was derived,
cos
E = (2.40)
4 x x 2
s
r
If the direction to the light source is given by s, then the radiance from a point
light source can be expressed with a delta function.
r
Li ( i ) = 2 (cos i cos s ) ( i s ) (2.41)
4 x xS
Substituting equation 2.41 into the reflectance equation yields
r r
r r
Lr ( r ) = f r ( i
r ) Li ( i ) cos i d i
r r (2.42)
= 2 f r ( r , s ) cos s
4 x xS
If there are n light sources, then the hemispherical integral collapses to a sum
over the n sources. This is the lighting model used by 3D graphics workstations.
It is easy to extend this model to light sources with arbitrary directional
distributions, as well as distant light sources. The above formulae are changed
to use the radiant intensity in the direction of the surface. In principle, linear
and area light sources can also be used, although this involves integrating the
reflectance function over the range of possible directions incident from the light
source. Nishita and Nakamae [175] and Amanatides [7] discuss this possibility.
r r x x
i = o = (2.44)
x x
cos o dA
d i = 2 (2.45)
x x
where
cos i cos o
G(x, x ) = G( x , x) = (2.47)
x x
2
Since this equation only involves outgoing radiances and directions, the sub-
scripts denoting incoming and outgoing directions can safely be dropped (except
from fr ).
Equation 2.48 was first introduced to the computer graphics literature by
Kajiya [135], who appropriately named it the rendering equation. Actually, his
notation (and development) is slightly different than that used in equation 2.48.
He introduced a new intensity quantity, I(x x)the two point transport
intensity from x to x (see Figure 2.15). This intensity quantity is a function of
surface position only and does not involve solid angles. The two point transport
intensity is defined by the following equation:
r
d = I(x x) = L(x, ) G(x, x) dA dA (2.49)
This is the flux flowing in the beam connecting dA to dA. Equation 2.48 can
be put in this form by multiplying both sides by G(x, x) dAdA which leads
to the following equation:
I(x x) = G(x, x) S fr(x x x) V(x, x) I(x x) dA (2.50)
Equation 2.50 defines the amount of light flowing from x to x and reflected to
x. Thus, it is sometimes referred to as the multipoint transport equation (see
Figure 2.16). The quantity
r r
fr(x x x) = fr(x, i ) (2.51)
Finally, the rendering equation can be simplified given the radiosity assumption.
In radiosity, it is assumed that all surfaces in the environment are Lambertian
diffuse reflector. Thus, the BRDF is independent of the incoming and outgoing
directions and can be taken out of the integral.
L(x x) = Le(x x) + fr(x) S L(x x) G(x, x) V(x, x) dA
= Le(x x) + (x)
S L(x x) G(x, x) V(x, x) dA
(2.53)
More importantly, the outgoing radiance from a Lambertian surface is the same
in all directions and in fact equals the radiosity B divided by . This leads to
even more dramatic simplifications.4
G(x, x ) V(x, x )
B(x) = E(x) + (x)
S B( x )
dA (2.54)
4
Note the switch in notation: E is the energy per unit area emitted by the surface,
or . In addition, for clarity in the following chapters, the geometric term G(x, x) will
absorb the visibility term and the p in the denominator.
Chapter 3
The radiosity equation was derived at the end of Chapter 2 from the render-
ing equation under the assumption that all surfaces (and light sources) exhibit
Lambertian diffuse reflection (emission). Repeating the radiosity equation 2.54:
where the geometric term, G(x, x), now includes the visibility term, V(x, x),
and division by . (A complete table of the mathematical terms used in this
chapter is provided in Tables 3.l and 3.2.)
The radiosity, B(x), describes an arbitrary scalar function across the sur-
faces (i.e., the radiosity function defines a single value at each location on a
surface).1 The potential complexity of the radiosity function is suggested by
Figure 3.1, where the radiosity function across a partially shadowed polygon is
plotted as a surface. The radiosity function is piecewise smooth, that is, it is
continuous in all derivatives within regions bounded by discontinuities in value
or derivatives. These characteristics will be discussed in much greater detail in
chapters 6 and 8.
The dimension of the function space of the radiosity function, B(x), is
infinite (for a discussion of function spaces, refer to the box on page 45). This
means that solving the radiosity equation for a point x on a surface does not
1
A full solution to the radiosity problem must also take into account the distribution of
energy across the visible spectrum (i.e., the color of the light). Assuming that the wave-
length of light is not changed by interaction with surfaces (i.e., ignoring fluorescence),
independent radiosity equations differing only in the reflectivities, r, can be formed and
solved for each of a small number of wavelengths or color bands. The selection of these
sample wavelengths and the reconstruction of colors suitable for display are discussed in
Chapter 9. Elsewhere in the book, the radiosity problem will be discussed in terms of an
achromatic (i.e., black, gray, white) world.
A great deal of research has been conducted on solving integral equations such
as the radiosity equation. A good source for this work is [69]. The finite element
approach used in radiosity methods is one of two distinct approaches that have
been taken in image synthesis to solving the global illumination problem.
One basic approach is the use of Monte Carlo or quasi-Monte Carlo ray
tracing to solve the rendering equation for locations and directions determined
by the view specification. This approach solves the rendering equation for only
those surface locations that are visible in the image and for only those directions
that lead back to the eye. If interreflection is limited to the ideal (mirror)
specular component and light sources are limited to point lights, Monte Carlo
evaluation of the rendering equation is essentially equivalent to classical ray
tracing. Ray tracing and Monte Carlo methods for image synthesis have been
extensively investigated [64, 135, 198, 215]. Basic Monte Carlo integration will
be discussed in Chapter 4.
Because the solution is limited by the view, ray tracing is often said to
provide a view-dependent solution, although this is somewhat misleading in that
it implies that the radiance itself is dependent on the view, which is not the case.
The term view-dependent refers only to the use of the view to limit the set of
locations and directions for which the radiance is computed. When a new view
is specified, previously computed radiances are still valid but are often no longer
relevant, and the rendering equation must be solved for a new set of locations
and directions.
The radiosity method is based on the other basic approach to solving the
Figure 3.1: An Image; the shadow on the floor; and the radiosity function across
the floor plotted as a surface.
Function Spaces
A function space defines a set of possible functions. For example, the ra-
diosity function is in the space of L2 functions over some finite domain S
(e.g., the surfaces). The L2 functions space is defined to contain all functions
f(x) such that
s | f (x) |2 dx <
In other words, the function is finite everywhere in the domain (except pos-
sibly in infinitesimal regions). Another function space would be the space
of all functions that are piecewise constant over integer intervals between 0
and 100. This function space can be defined as a linear sum of a box basis
functions:
99
f (x) = f
i=0
i Ni (x)
2
In the case of the radiosity function, whose domain is the surfaces of the environment
but where the interaction occurs across the space between surfaces, boundary element
methods are specifically relevant. The basic approximation method in finite and boundary
element methods is the same.
5. Compute the coefficients of the linear system. These coefficients are pri-
marily based on the geometric relationships that determine the transport
of light between elements. The geometric relationships are called form
factors.
6. Solve the resulting system of equations for the unknown nodal radiosity
values.
Ni (x) =
0 if x is outside element
(3.3)
1 if x is inside element
The number and placement of nodes within elements will depend on the order
of the polynomial. In the case of constant elements, defined by constant basis
functions, a single node located in the center of the element is commonly used.
The radiosity function across linear elements is defined by nodes and as-
sociated basis functions at the boundaries or corners (in two dimensions) of
the element. A simple example of function approximation using linear bases is
shown in Figure 3.4 for a function of a single variable. In this example, a linear
basis function is associated with each node, and the nodes are located at element
boundaries. The linear (or hat) basis function in one dimension is defined by
xx i 1
for xi 1 < x < xi
x x
x x
i i 1
Ni ( x) = x x i +1
for xi < x < xi +1
0
i +1 i (3.4)
otherwise
In Figure 3.4 the nodal values, Bi , are determined by simply evaluating the
function to be approximated at the node locations. In general, the function to be
approximated is not known, thus the coefficient values are computed to minimize
an error estimate or provide an overall best fit according to some criterion.
The generalization of finite element approximations to functions defined
over a two-dimensional domain, such as the radiosity function, is straightfor-
ward (see Figure 3.5). The elements are typically simple shapes, usually tri-
angles and/or convex quadrilaterals. Nodes for constant, linear, and quadratic
elements are shown in Figure 3.6. The approximation of a function for a single,
two-dimensional element using constant and linear basis functions is shown in
Figure 3.7. Note that the tensor product of the two one dimensional linear basis
functions results in a bilinear basis in two dimensions and is thus curved along
the diagonals.
Figure 3.4: Finite element approximation of a function using linear basis func-
tions.
In two dimensions, the linear basis function, Ni (x), has the properties:
1 at node i
0...1
within adjacent elements
Ni (x) = (3.5)
0 at all other node points
0 outside adjacent elements
This definition ensures that the basis function associated with a particular node
is zero outside of the elements adjacent to the node, as well as at any other
nodes within those elements.
The variation of the linear basis function from a value of 1 at the node
to 0 across the element depends on the parametric mapping of a generic basis
defined on a standard element to the triangular or quadrilateral elements. In the
case of triangles, barycentric coordinates are often used to define the 2D linear
basis. In the case of quadrilaterals a tensor product of two one-dimensional
linear basis functions defines one quarter of a bilinear basis within each element.
For example, the value of the hat function is determined by the interpolation,
Ni (x) = (1 u)(1 v), where (u, v) is the (0, 0) to (1, 1) parametric coordinate
of the point x within the element with node i at the parametric origin (see
Figure 3.9). Parametric mappings are discussed briefly in section 3.8 and in
more detail in most finite element texts [273].
Elements constructed using other types of basis functions are also possible.
For example, cubic Hermite elements provide continuity of derivatives across
element boundaries by using basis functions that interpolate function derivatives
at the nodes as well as values. Given the radiosity values and their paramet-
ric derivatives at the four corners of a quadrilateral, one can derive a bicubic
variation of radiosity across the element. Hybrid sets of basis functions with
constant, linear, and higher-order functions can also be employed. Other poly-
nomial bases (e.g., Jacobi polynomial sets [270]) and non-polynomial functions
are other possible choices. For a given approximation accuracy, there is typi-
cally a tradeoff between the number of elements required and the complexity of
the basis functions.
with the actual solution B(x) everywhere. This is not possible in general since
B(x) is restricted to the finite subspace of functions representable as the linear
sum of the selected basis functions. Given the choice of basis functions, the
goal is then to find the nodal values that generate a solution minimizing the error
according to some measure or metric.
The actual error, (x), is the difference between the approximate and exact
solutions, that is,
(x) = B(x) B(x)
(3.6)
Unfortunately, it is impossible to determine (x) directly since the exact solution
is not known.
An alternative characterization of the error is provided by the residual. If
B (x) is substituted for both occurrences of B in the original radiosity equation
B(x)
= E(x) + (x) s B(x) G(x, x) dA (3.7)
then the residual function is given by the difference of the left and right hand
ides
r(x) = B(x)
E(x) (x) s B(x) G(x, x) dA (3.8)
An exact solution will make r(x) zero everywhere, but this is unobtainable since,
as we have seen, B is restricted to the subspace of functions realizable using the
basis functions. Although B is restricted to a finite function space, the residual,
r, is not. However, a similar approach to that taken in approximating B can
be taken to project the residual into a finite function space. In this way, rather
than seek a solution technique that makes r(x) zero everywhere, the goal will
instead be to minimize r(x) according to a finite dimensional error metric.
The general approach is to choose n independent weighting functions, Wi(x),
each having local support, much like the earlier basis functions. The norm or
size of the residual is then approximated as a finite sum:3
n
r(x) =
i=1
< r(x), Wi (x) > (3.9)
This residual norm can be driven to zero by finding radiosity values such that
each of the n terms < r(x), Wi(x) > is equal to zero. As will be derived below,
3
The notation < f(x), g(x) > indicates the inner product of the two functions. The
inner product of two functions is analogous to the dot product of two vectors and is
defined to be
< f(x), g(x) > = s f(x) g(x) dx
If < f(x), g(x) > = 0, then f(x) and g(x) are orthogonal.
setting each of these terms to zero results in a linear equation. The set of n
such linear equations (one for each weighting function) of the n nodal values,
Bi , can be solved simultaneously as discussed in Chapter 5.
This approach defines a general class of methods called weighted residual
methods. Two different choices for the weighting functions Wi(x) lead to two
contrasting formulations, point collocation and the Galerkin method, which will
be discussed in the following sections.
Wi(x) = (x xi ) (3.10)
Note that the only change from equation 3.8 to equation 3.11 is that equation
3.11 is defined only at the n node locations, xi , as opposed to the entire surface
domain, S. Expanding B using equation 3.2 gives
s B N (x) G(x , x) dA = 0
n
Grouping terms and factoring Bj, which is independent of x, out of the integral
leaves
n
B j N j (x i ) (x i ) S N j (x ) G(x i , x ) dA' E(xi ) = 0 (3.13)
j =1
Equation 3.13 can be restated simply as the set of n linear equations
j =1
Bj Kij E(xi ) = 0 (3.14)
or in matrix/vector form as
KB=E (3.15)
These coefficients are independent of the nodal radiosities and are defined solely
by the geometry and material properties of the environment. The evaluation of
these coefficients will be the topic of the following chapter. However, it should
be noted here that for any particular term, Kij, the integral only needs to be
evaluated over the nonzero support of the jth basis function. Also, the term
Nj(xi ) is simply the Kronecker delta ij , (i.e., one if i = j and zero otherwise),
for constant and linear basis functions with local support limited to adjacent
elements. Equation 3.14 completes the objective of deriving a linear system of
equations that can be solved for the unknown nodal radiosities, Bi .
0= s W (x) B (x) dA
i
The Galerkin formulation selects the same basis functions used to approx-
imate the radiosity function as the weighting functions, (i.e., Wi(x) = Ni(x)),
thus, equation 3.18 becomes,
0= s N (x) B (x) dA
i
n
B j S Ni (x) N j (x) dA S N (x) (x) S N (x ) G(x, x ) dA dA
i j
j =1
s E(x) Ni(x) dA = 0 (3.20)
The unknowns, Bj , have been isolated in this expression. There are n such
expressions, one for each node i and, as with point collocation, the linear system
of equations can be expressed as the matrix equation
KB = E (3.21)
Ei = s E(x) N (x) dA
i (3.23)
The Galerkin method has been explored for one-dimensional flatland radiosity
by Heckbert [122, 123].
The previous two sections have taken two different approaches to achieving
the same basic objective, a linear system of equations for the discrete nodal
values. However, the relationship of these equations to the physical problem
of global illumination may still be somewhat obscure. The complexity in the
above formulations is reduced if constant basis functions are used, with the
reflectivity and emission of each element assumed to be constant. This set
of assumptions has been made in most radiosity implementations to date and
provides the clearest physical intuition.
For constant basis functions, Ni , the Galerkin formulation can be rewritten
by performing the integration for each term in equation 3.20. First, using the
fact that the box basis functions have values of only 11 and 0, and do not overlap
with one another,
Ai if i = j
s Ni(x) Nj(x) dA = = ij Ai (3.24)
0 otherwise
where ij is the Kronecker delta, and Ai is the area of element i. Note that
the integration only has to be performed across elements i and j since the
corresponding basis functions are zero elsewhere. Likewise,
s E(x) N (x) dA = E A
i i i (3.25)
(3.26)
Making these substitutions into equation 3.20 results in, for all i:
n
B j ij Ai i
Ai Aj G (x, x ) dA j dAi Ei Ai = 0 (3.27)
j =1
Dividing through by Ai and moving the emission term to the right side gives
n 1
B j ij
i
Ai Ai Aj G (x, x ) dA j dAi = Ei
(3.28)
j =1
or
n
[
B j ij i Fij
j =1
] = E i (3.29)
Fij =
1
Ai
Ai Aj G (x, x ) dA j dAi (3.30)
The form factor represents the fraction of energy that leaves element i and arrives
directly at element j. Evaluating the form factor is the topic of Chapter 4.
As in previous formulations, the system of equations can be represented by
the matrix equation K B = E. As evident in equation 3.29, the entries in K are
given by
Kij = ij i Fij (3.31)
A more physically intuitive form is obtained by first reinserting the area terms,
Ai: n
Bi Ai = Ei Ai + i Bj Fij Ai
j =1
(3.33)
1 1 F1,1 1 F1,n B1 E1
F 2 F2,n B E
2 2,1 2 2
= (3.36)
n 1 Fn 1,1 Bn 1 En 1
n Fn,1 1 n Fn,n Bn En
Solving this linear system is the topic of Chapter 5. The radiosity formulation
for constant elements that has just been derived will be used for most of the
remainder of the book.
For orthonormal bases, this results in an identity since the inner products will
be zero unless they are the same function. Put differently, the terms in M
are zero unless the basis functions overlap as, for example, for linear functions
associated with nodes belonging to the same element. Thus, the M matrix is
sparse. The nonzero area terms, in the case of constant bases, are divided out
and disappear in the classical radiosity formulation.
In general, however, it is not possible to divide through by the area terms a
with the constant basis functions. Instead, one must be satisfied with the general
form
K=MPF (3.38)
for interpolation, integration of form factors, and other operations can then be
developed to act on the standard elements in their local setting and the results
transferred to the specific element in the global environment. This eliminates a
great deal of awkwardness that may be associated with working directly in the
more general global setting of planes and curved surfaces in three-dimensional
space.
Although many master element shapes are possible, most applications use
triangles and quadrilaterals. The original elements may or may not be planar;
however, it is important that there is an invertible mapping from the world space
coordinates to the two-dimensional (u, v) parametric coordinates of the master
element (see Figure 3.9). Typically, the master element coordinates are defined
over the unit 0 to 1 interval or the two unit -1 to 1 interval.
In the case of planar elements, the (u, v) coordinates are typically derived
by establishing a coordinate system on the plane of the element. Surface patches
that are already defined in terms of parametric coordinates may require a further
scaling to the master element coordinate system.
It is also important to be able to determine the transformation of differential
areas to the parameterized space. This requires careful attention in the case of
parametrically defined polygons and curved surface patches.
functions are possible, commonly the basis functions themselves are used as the
mapping functions. This is called an isoparametric mapping.
In this case, both the radiosity function and the geometry are mapped in
the same way. For linear basis functions, the one-to-one mapping requirement
will permit the use of triangles and convex quadrilaterals in parametric space.
Quadratic basis functions will permit three- and four-sided elements bounded by
quadratic curves to be mapped to square master elements. A full set of element
types and mapping functions can be found in most finite element texts such as
[273]. In the case of constant basis functions a superparametric mapping is
often employed using barycentric and bilinear functions to map triangles and
quadrilaterals to equilateral triangular and square master elements.
The example of linear bases and a square master element ranging from (0,0)
to (1,1) results in four mapping functions for the four corner nodes,
1
N0,0 (u, v) = 4 (1 u) (1 v)
1
N1,0 (u, v) = 4 (v) (1 v)
(3.40)
1
N1,1 (u, v) = 4 (v) (v)
1
N0,1 (u, v) = 4 (u) (v)
These mapping functions can then be used to find the world coordinates corre-
sponding to a parametric location inside a master element, thus defining the shape
of the element in world coordinates. If the world coordinates of the four corners
of a quadrilateral element are (in counter-clockwise order) x1, x2, x3, and x4, then
4
x(u, v) = N
i =1
i (u, v)x i (3.41)
The inverse of this mapping function is described in section 9.2.1 in the context
of interpolating radiosity values. In a similar fashion, curved element geometries
can be defined with higher order basis functions.
3.9 Summary
This chapter has provided a mathematical framework for approximately solving
the radiosity integral through the solution of a system of linear equations. Given
this framework, many practical questions remain to be explored. What is a
good element subdivision and how can it be obtained automatically? How are
the coefficients of the K matrix to be computed numerically and how is the
Chapter 4
K = M PF (4.2)
where M and P are diagonal in structure and defined by the selected basis
functions and element reflectivities, respectively. The form factors (entries in F)
make up the most important component of K. They are central to the radiosity
method and to understanding the propagation of light within an environment.
Simply put, the form factor represents the geometric relationship between two
surface areas, although, depending on the selection of basis functions, the form
factor will take on more and less intuitive meanings. In the common case of
constant basis functions, the form factor represents the fraction of light leaving
one element that arrives directly at another. Thus, in the case where one element
is a light source, the form factor itself represents the direct illumination of the
other element per unit of emissive power from the light. The form factor is
purely a function of geometry. It does not depend on the reflective or emissive
characteristics of the surfaces. It does depend on the distance and orientation of
the two elements, as well as the visibility relationship between them.
The computation of each form factor and thus each Kij involves evaluating
an integral of a geometric kernel over the areas of support of two basis functions.1
Integrals of this type can sometimes be solved in a closed form, and this will
be the case for special geometric arrangements of the elements. These special-
case analytic formulae will be discussed; however, in general, there will be no
closed form solution for this integral. Thus the bulk of the chapter will explore
a variety of numerical algorithms designed specifically for this problem.
where Ni(x) and Nj(x) are the basis functions evaluated at x and x and G(x, x)
incorporates the geometric and visibility relationship between the two regions
as it affects radiant energy transport.
In the case of constant basis functions, Ni(x) and Nj(x) are both equal to
1 over the finite areas of the corresponding elements. In this case, the M matrix
is simply a diagonal matrix of element areas. Thus, each equation in the system
can be divided by the area of the corresponding element. Then M is simply the
identity and
Fij =
1
Ai Aj Gij dAj dAi (4.4)
Ai
where the geometric kernel is now denoted using the shorthand Gij . In this case,
the coefficients Fij take on a particularly intuitive physical meaning: Fij is the
fraction of light leaving element i that arrives directly at element j. The Fij in
1
One basis may be a point as in the case of point collocation.
2
The same basis set is used in Galerkin methods.
this case are commonly called form factors.3 We will use the term form factor
for both constant and higher order bases, although the physical interpretation is
somewhat less straightforward in the more general case.
The form factor is purely a function of the geometric relationship between
elements and thus does not depend on the reflectivity (color) of surfaces. This is
a potential advantage of the radiosity method, since it allows surface attributes
to be changed without repeating the expensive form factor computation.
The geometric kernel in equation 4.3, G(x, x), was derived in Chapter 2. It
corresponds to the form factor between differential areas dA and dA and is
given by
cos cos cos
dF dAdA = d = dA (4.5)
r(x, x ) 2
3
Form factor has emerged as the common term in image synthesis. In the field of
heat transfer, the terms configuration factor and shape factor also appear, among others.
The full form factor integral for constant bases, equation 4.4, involves performing
an integration over the support of two basis functions (i.e., the two element
areas). Three different formulations of this form factor integral between elements
can be derived. Each is used in the algorithms that will be described in the
following sections.
The first formulation results from inserting the differential form factor (equa-
tion 4.6) into the form factor integral, equation 4.4. Thus, the element-to-element
form factor is the double area integral, with geometric kernel, Gij ,
cos i cos j
Fij =
1
Vij dAj dAi (4.7)
r2
Ai Aj
Ai
where Vij is the visibility term between differential areas dAi and dAj .
The second formulation results from replacing the inner integration over area
with an equivalent integration over the hemisphere around dAi . The differential
solid angle (see Figure 4.2) dwj from dAi to dAj is
cos j
d j = dAj (4.8)
r2
Thus, the inner integral of equation 4.7 can be rewritten over the hemisphere of
directions, , and over dAi , resulting in the area-hemisphere integral,
cos i
Fij =
1
Vij d j dAi (4.9)
Ai
Ai
r
where Vij is now 1 if element j is visible from dAi in direction d j . The new
geometric kernel, Vij cos i/, will be denoted Gi. This alternate form of the
integral will be used in some algorithms to compute the form factors from dAi
to all elements at once.
If the elements are assumed to be fully visible to one another, a third vari-
ation of the form factor integral can be derived by applying Stokes theorem to
convert the double area integral into a double contour integral [143, 222]. The
result (not derived here) is
1
Fij = ln r dxi dx j + ln r dyi dy j + ln r dzi dz j (4.10)
2 Ai Ci C j
where Ci and Cj are the boundaries of elements i and j. This third form of the
integral will also be used by some algorithms when visibility can be determined
of specialized configurations. In the same year Gershun [93] puts various photometric
quantities on a vector calculus footing and gives an especially elegant derivation of the
double contour integration using differential forms. Sparrow [221] in 1963 used the dou-
ble contour form to derive closed form solutions for the case of parallel disks and parallel
quadrilaterals. However none of these sources or any since that we are aware of has
iven a closed form solution of the form factor between two general polygons.
The analytic formula for the form factor from a differential area to a polygon is
particularly useful, since polygonal models are often encountered in image syn-
thesis [19, 130, 143, 175]. The geometry for this formula is given in Figure 4.7.
The form factor is computed as a sum around the perimeter of the polygon:
n
cos
1
FdAi A j = (4. 15)
2
i i
i =1
or equivalently,
n
N
1
FdAi A j = (Ri R(i +1)%n ) (4.16)
2
i i
i =1
where n is the number of sides on the polygon, bi is the angle between Ri and
R(i+1)%n in radians, ai is the angle between the plane of differential area dAi
and the triangle formed by dAi and the ith edge of the polygon, and Ni is the
unit normal to dAi.
This formula does not take into account occlusion. However, in conjunction
with the appropriate visibility algorithm, the form factor algebra can be used
to compute an exact result. In an algorithm by Nishita and Nakamae [175],
the form factor to the original polygon is first computed, ignoring occlusion.
F j,i A j + F k,i Ak
Fi,( j + k ) = Fi, j + Fi,k F( j + k ),i = A j + Ak (4.13)
r2
Fij = (4.14)
h2 + r 2
Other polygons in the scene are clipped against this polygon (as viewed from
the differential area) and against each other. The form factor to each of the
clipped polygons is computed and subtracted from the unoccluded form factor,
giving the form factor to the visible portion of the original polygon.
Schrder and Hanrahan give a closed form solution for general polygon-to-
polygon form factors, ignoring occlusion [206]. The formulation is non-elemen-
tary, as it is based on the dilogarithm [151] arising in the integration of the
contour integral form of the form factor, equation 4.10. The specifics of the
closed form solution are not repeated here as they involve a long series of
complex terms.
Closed form analytic formulae do not lend themselves to the direct evaluation of
form factors between complex shapes or where occlusion is a factor. For more
general situations, numerical approaches are required to approximate the form
factor.
Numerical methods of evaluating integrals (known as quadrature methods)
generally involve sampling the kernel at various points and approximating the
integral as a weighted sum of the kernel evaluated at the sample points. In
general, the more sample points selected, the more accurate the approximation.
However, the cost of approximating the integral is directly related to the num-
ber of kernel evaluations required (each of which generally requires a visibility
calculation). Thus, the goal in developing a numerical algorithm (or quadrature
rule) to solve the form factor integral is to get the most accuracy with the fewest
(and/or cheapest) kernel evaluations.
There are a number of choices to make in designing a quadrature rule for
form factor evaluation. First, in the case of constant basis functions, one can
choose to evaluate any of the different formulations of the form factor integral
given in section 4.3. The area-area form (equation 4.7) and the area-hemisphere
form (equation 4.9) are equivalent, and the contour form (equation 4.10) is also
a suitable choice if one can determine a priori that the elements are fully visible
to one another.
In addition, there is not just a single form factor to be evaluated, but rather
a matrix of form factors. Each entry of a row (or column) of the form factor
matrix shares a common element as the domain of integration, thus one may
take advantage of this coherence by simultaneously solving for a complete row
and/or column of form factors.
Finally, one is free to a great extent to choose where to sample the kernel
and how to weight the samples so long as it can be shown that as the number
of samples increases, the weighted sum converges to the true solution.
After a brief discussion of the general topic of numerical integration, the
chapter will proceed with a description of a variety of numerical algorithms that
have been developed for form factor evaluation. Other surveys of form factor
algorithms such as [78, 187] provide additional insights. The approaches are
broadly classified according to which form of the form factor integral they use,
how the sample points are selected and weighted, and in what order the form
factors are evaluated (e.g., one at a time or a row at a time).
H = X h(x) dx H = w h(x )
k =1
k k (4.17)
One is free to use any information available about h(x) in choosing the quadra-
ture points, xk .
Normally, one would like to make n as small as possible to limit the cost
incurred in the evaluation of the h(xk ), without compromising accuracy. The
simplest methods, like the trapezoidal rule or Simpsons rule, sample the domain
at evenly spaced intervals, evaluate the kernel at these points, and sum the results
weighted by the size of the interval. Clearly, as the number of samples increases,
and the size of the intervals decreases the approximation approaches the true
integral.
the samples are selected. If, for example, samples are evenly distributed in the
domain, then the weights are simply for n samples with A the size of the
domain of integration.
One would like, however, to make as few evaluations of the integrand as
possible to reach an answer with some level of confidence of being within some
error bound. This process can be enhanced by taking advantage of whatever
knowledge one has of the integrand. For example, if the integral H to be
evaluated has a kernel h(x) that can be factored, h(x) = f(x) g(x), where
g(x) is a simple known positive function (g(x) > 0 for x X), then the
integral can be written
H = X f(x) g(x) dx (4. 18)
In this case, one would like to find a distribution of samples xk in X that mimics
the known function, g(x). This method of selecting samples is called importance
sampling, since more samples are taken where g(x) is large (important) and
fewer are taken where g(x) is small. More formally,
where
G = X g(x)dx and p(x) =
g( x )
G
(4.20)
p(x) is essentially a normalized g(x) (i.e., p( x) = 1) and is thus a prob-
ability density function. The cumulative density function P(x) can be defined
as
x
P(x) = p(x) dx
(4.21)
Loosely speaking, if p(x) represents the odds of picking x, then P(x) represents
the odds of picking some number less than or equal to x. If the inverse of the
function P(x) is P1(x), then the Monte Carlo evaluation for the approximation
H H is simply
H = 0;
for ( k = 1 to n) { for n samples
choose ; randomly in the interval from 0 to 1
x = P1 () ; x will be chosen with probability p(x)
H = H + f(x) ; sum the sample values of f(x)
}
H = H * Gn ; normalize by G and divide by n samples
Fij =
1
Ai Gi d dAi Gi d at sample point xi (4.22)
Ai
This assumes that the inner integral is constant across element i, which may
be reasonable when the distance (squared) is much greater than the area of
element j. However, changes in visibility between elements i and j also affect
the validity of this approximation. Whether or not this assumption is used, or
the inner integral is evaluated at many sample points in element i, one is left
with the problem of evaluating the inner integral. This will be the topic of the
following sections.
cos i
Gi = Vij (4.23)
r
The visibility term, Vij , which is 1 if element j is visible in direction d , is
the computationally expensive part of the kernel evaluation. Determining the
visibility of an element j in a particular direction involves intersecting a ray
emanating from dAi with element j and with all surfaces that may block the
ray.
Since form factors from element i to all elements are needed eventually,
there is a clear advantage in performing the visibility calculation once and simply
summing a differential form factor into Fik , where element k is the element
r
seen in direction d from dAi. Thus, a single integration over the hemisphere
results in a full row of differential area-to-element form factors. Given this
observation, the question is how to sample the hemisphere of directions above
dAi , and how to perform the visibility calculations in the chosen directions.
Hemisphere sampling approaches can be principally differentiated by the
hidden surface algorithm they use. Certain algorithms provide efficiency by
exploiting coherence in the geometry of visible surfaces, while others provide
flexibility for stochastic, adaptive or nonuniform sampling. A geometric analog
to the differential area-to-area form factor equation is given first to provide some
useful intuition for the algorithms that follow.
Figure 4.8: Nusselt analog. The form factor from the differential area dAi to
element Aj is proportional to the area of the double projection onto the base of
the hemisphere.
same solid angle. Likewise, if an element is projected radially onto any inter-
mediate surface, as in Figure 4.9, the form factor for the projection will be the
same as for the element itself. This observation forms the basis for the hemicube
form factor algorithm, in which elements are projected onto the planar faces of
a half cube instead of onto a hemisphere [62].
A hemicube is placed around a differential area (see Figure 4.10), with
the hemicube faces subdivided into small grid cells. Each grid cell defines a
direction and a solid angle. A delta form factor, F, is computed for each
cell based on its size and orientation (see Figure 4.11). For this purpose, it is
convenient to consider a unit hemicube (i.e., with a height of 1, and a top face
2 3 2 units), although the size of the hemicube is arbitrary, since it is the solid
angles subtended by the grid cells that are of interest. The delta form factors are
precomputed and stored in a lookup table. Only one eighth of the delta form
factors need be stored, due to symmetry (one eighth of the top face and half of
one side face).
Each face of the hemicube defines a perspective projection, with the eye
point located at the differential area and a 90 viewing frustum.7 The form
factor to an element is then approximated by projecting the element onto the
7
The sides of the hemicube actually define the top half of a 90 frustum since the
bottom half falls below the horizon.
Figure 4.9: Areas with same form factor. Areas A, B, and C, have the same
form factor as Aj from dAi .
faces of the hemicube and summing the delta form factors of the grid cells
covered by the projection. The visibility problem of determining the closet
surface for a regular grid of cells is, of course, a familiar one in computer
graphics, since it is essential to producing a raster image. The hemicube uses
the Z-buffer algorithm [84], which is simple and efficient, and has the additional
advantage of wide availability in hardware graphics accelerators.
The only difference between rendering onto the hemicube and normal image
rendering is that in addition to a Z depth, an ID for the visible element is stored
at each grid cell, instead of a color (the result is often called an item buffer after
[260]). The distances are initialized to infinite and the identifiers to NONE.
Each element in the environment is projected onto the face of the hemicube one
at a time. If the distance to the element through each grid cell is less than what
is already recorded, the new smaller distance is recorded as well as the identifier
for the element. When all elements have been processed, each grid cell will
contain an identifier of the closest element. The grid cells are traversed and the
delta form factor for each cell is added to the form factor for the element whose
Fi, j = F
qj
q (4.26)
1
FdAi = Ai (4.24)
x + zi2 + 1
2
i
zi
FdA j = Aj (4.25)
y + z 2j + 1
2
j
by a one-point quadrature from the center of the hemicube to the hemicube pixel
centers.
The efficiency of the hemicube derives from the incremental nature of the Z-
buffer algorithm, which exploits coherency in the projected geometry. However,
the inflexibility of the Z-buffer is also the source of many of the hemicubes
disadvantages.
The hemicube divides the domain of integration, the hemisphere, into dis-
crete, regularly spaced solid angles. When projected elements cover only a few
of the grid cells, aliasing can occur. The result is often a plaid-like variation in
shading as the hemicube subdivision beats against the element discretization (see
Figure 4.14). Very small elements may fall between grid cells and be missed
entirely. This is a particular problem for small, high-energy elements like light
emitters. Increasing the hemicube resolution can reduce the problem, but this
Radiosity and Realistic Image Synthesis 84
Edited by Michael F. Cohen and John R. Wallace
CHAPTER 4. THE FORM FACTOR
4.9. EVALUATING THE INNER INTEGRAL
/* Top */
dx = dy = 2.0/res;
x = dx/2.0;
A = 4.0/(res2);
for ( i = 1 to res ) {
y = dy/2.0;
for ( j = 1 to res ) {
F[i][j] = 1.0/( * (x2 + y2 + 1.0)2);
y = y + dy;
}
x = x + dx;
}
/* Side, Note: keep track of ordering for scan conversion below */
dx = dz = 2.0/res;
x = dx/2.0;
A = 4.0/(res2);
for ( i = 1 to res/2) {
z = dz/2.0;/* Note: z goes from bottom to top */
for ( j = 1 to res ) {
F[i][j] = z/( * (x2 + z2 + 1.0)2);
z = z + dz;
}
x = x + dx;
}
uniform grid, the hemicube spends as much time determining form factors close
to the horizon as it does near the normal direction.
Max [162] has investigated variations of the hemicube in which the reso-
lution of the top and sides are allowed to differ, the cubical shape can become
rectangular, and the sizes of the grid cells are allowed to vary with position. By
assuming a statistical distribution of the elements being projected, he derives
optimal resolutions, shapes, and grid cell spacings to reduce quadrature errors.
For example, a top face resolution about 40% higher than for the sides, and a
side height of approximately 70% of the width provides are found to minimize
the error for a given number of grid cells.
The advantage of the hemicube is that it determines form factors to all
elements from a single point. This can also be a liability if only one form factor
is required. In addition, computing the full area-hemisphere form factor requires
repeating the hemicube9 at a sufficient number of sample points on element i
to ensure the desired accuracy for elements that are relatively close together.
9
Rotating the hemicube for each selected sample point is useful for eliminating aliasing
artifact.
Increasing accuracy in this way will be inefficient, since element i will be close
to only a fraction of the other elements in the environment, and the effort of the
extra hemicube evaluations will be wasted for elements that are distant from i.
In spite of these limitations, the hemicube can be a useful and efficient means
of computing form factors, as long as its limitations are taken into account.
Baum et al. [19] provide an extensive discussion of the inaccuracies introduced
by the hemicube, along with useful error estimates. Comparing results for the
hemicube to analytic results for a variety of geometries, Baum et al. find that
elements must be separated by at least five element diameters for the relative
error in the form factor to drop below 2.5 percent. This result will naturally
depend on the particular geometries and hemicube parameters, but it provides a
useful rule of thumb.
A cube is, of course, not the only solid constructed of planar faces, and
other shapes might be used similarly to the hemicube in constructing faces for
projection and scan conversion. For example, Beran-Koehn and Pavicic [24, 25]
describe an algorithm similar to the hemicube based on a cubic tetrahedron.
Spencer [223] describes the use of a regularly subdivided hemisphere.
Sillions algorithm can also compute form factors that take into account
specular surfaces. Rays are cast through the corners of the region if the visible
element is specular and traced recursively until a diffuse element is encountered
(see Figure 4.15).
Single plane algorithms are based on projection, like the hemicube, and thus
compute form factors from a single point. The single plane thus has the same
problems as the hemicube for computing full area-hemisphere form factors.
Ray tracing (as opposed to scan conversion and the Z-buffer) provides an ex-
tremely flexible basis for evaluating the visibility term in the numerical integra-
tion of the form factor equation. Because rays are cast independently they can
be shot to and from any distribution of points on the elements or directions in the
hemisphere. Nonuniform and adaptive sampling can be used to distribute com-
putational effort evenly. Rays can also be distributed stochastically, which can
render the effects of inadequate sampling less noticeable by converting aliasing
to noise.
In addition, ray tracing handles a wide variety of surface types, including
curved surfaces, and a number of efficiency schemes to accelerate ray intersec-
tions exist. A disadvantage of ray tracing is that the expense per quadrature
point will generally be higher since coherency from ray to ray is more difficult
to exploit than in scan conversion algorithms.
Ray casting provides an excellent basis for Monte Carlo integration of the
form factor equation over the hemisphere. In equation 4.9, the kernel contains
the factor cos i . Thus importance sampling can be performed by selecting
directions over the hemisphere with a sample density proportional to the cosine.
In this way, more effort will be expended where the form factor is largest.
Since the density of rays is then proportional to the differential form factor,
each sample will carry equal weight.
Malley describes a straightforward method for generating a set of sample
cos i cos j
FdAi A j = Vij dAj . (4.27)
r2
Aj
Figure 4.17: Numerical integration of form factor from differential area to finite
area.
m cos ik cos jk
F dA A =
i j
k=1 (r )
k 2
V(dAi , A jk ) A jk (4.28)
The equation is evaluated by shooting a ray from dAi to each delta area to
determine the visibility, V(dAi , Ajk ). The contributions of those delta areas
that are visible is then summed.
Equation 4.28 assumes that the subareas are reasonable approximations to
differential areas, which is the case only if Ajk << r2. Otherwise, Ajk
should be treated as a finite area. For example, each term of the summation
could evaluate the exact polygon form factor formula for the particular subarea,
as discussed in Tampieri in [230].
A less expensive alternative is to approximate Ajk by a finite disk of the
same area, as suggested by Wallace et al. [247]. The analytic formula for a point-
to-disk form factor can then be substituted into the summation of Equation 4.28.
The form factor from a differential area to a directly opposing disk of area Aj
Figure 4.18: Configuration for approximation of the form factor from a differ-
ential area to arbitrarily oriented disk.
is
Aj
FdAi A j = (4.29)
r + Aj
2
Aj cos i cos j
FdAi A j = (4.30)
r 2 + Aj
The form factor from a differential area to an element j approximated by a
set of m disks of area Aj /m is thus
m cos ik cos jk
F dA A = A j
i j
k=1 (r k ) 2 +
Aj V(dAi , A j ) (4.31)
m
The reciprocity relationship can also be used to approximate the form factor
from a finite area to a differential area through the ratio of the areas:
The disk approximation breaks down when the distance from the disk to
the receiver is small relative to the size of the delta area, and visible artifacts
may result, as shown in Figure 4.19(a). An additional difficulty with uniform
subdivision of the element is that since a single ray is cast to each of the source
subdivisions, the element is essentially treated as several point lights as far
Figure 4.19: (a) Artifacts introduced by the disk approximation. The receiving
surface consists of 30 by 30 elements. (b) Adaptive subdivision of the source
element for a typical node on the receiving element.
simple area-to-area Monte Carlo form factor algorithm is given in Figure 4.21
(the geometry is shown in Figure 4.20).
Fij = 0
for k = 1 to n
randomly select point xi on element i or use stratified sample
randomly select point xj on element j or use stratified sample
determine visibility between xi and xj
if visible
compute r2 = (xi xj)2
r r
compute cosj = rij Ni
r r
compute cosj = rij N j
the boundaries. Care must be taken when the boundaries are shared between
elements, as ln(r) is undefined as r 0.
Equation 4.10 does not account for occlusion. It only the inner contour
integral is to be evaluated (in computing, a differential area-to-area form factor),
occlusion can be accounted for using a polygon clipping approach such as Nishita
and Nakamae s [175].
Figure 4.23: Test results on parallel elements. In Test1, only the center point
was chosen on element i and n points on element j. In Test 2 n points are chosen
on both elements. res is the resolution of the hemicube in both tests.
was chosen for sample points in element i and the horizontal axis represents the
product of the number of sample points and directions.
All of the methods converged reasonably well in this case as the sampling
density (resolution, in the case of the hemicube) increased. Note that the form
factor from the center of element i to element j is approximately 0.2395, and
thus the solution always converged to about 20% over the actual value for Test
1. Also, note the single point on the graph for the hemicube with resolution 2
performed at 2 random points chosen on element i. Because of the low resolu-
tion and the fixed orientation of the hemicube with respect to the environment
coordinate frame, the form factor happens always to be the same, no matter
where the hemicube is position on element i. This extreme case highlights the
problems due to the regular sampling enforced by the hemicube that are en-
countered as the resolution becomes small relative to the projected area of the
elements.
The discussion so far has been limited to evaluating form factors where con-
stant basis functions are used. This has been the dominant approximation used
in radiosity implementations to date. In this section we briefly introduce the
computation of form factors for higher order elements. However, this remains
largely an area for future development.
Recall from the last chapter that the coefficients of the linear operator K are
given by
Kij = Mij iFij (4.33)
For orthonormal (e.g., constant) bases the M matrix is simply the identity
after division by area terms. In the more general case, it represents the inner
product of the ith and jth basis functions:
Mij = s Ni(x) Nj(x) dA (4.34)
The integral will be nonzero only where the support of the two basis functions
overlaps. This integral can generally be evaluated analytically since the basis
functions are chosen to be simple polynomials.
Slightly reorganizing equation 4.3, the Fij are given by
Fij =
Ai Aj Ni (x) N j (x9) G(x, x9) dA9 dA (4.35)
The interpretation of the coefficients Fij is slightly less intuitive in this general
case. The integral is still over the support (Ai, Aj) of the two basis functions
as before. The only difference is the inclusion of the basis functions in the
integrand. The form factor now represents the exchange of energy between
regions under the support of the basis functions, weighted by the local values
of basis functions.
The Monte Carlo algorithm described earlier in section 4.10.1 for evaluating the
area-to-area form factor can also be generalized to higher order elements. The
algorithm is basically unchanged, except that each sample point on Ai and Aj
now contributes to the form factor for each of the nonzero basis functions at that
point, with the contribution weighted by the value of the basis function. A single
ray between two sample points x and x9 can be used to contribute to more than
one Fij if the basis functions overlap. For example, with linear, quadrilateral
elements, a single ray will typically result in 16 (4 i bases 3 4 j bases) nonzero
Figure 4.24: Monte Carlo for form factors with general basis functions.
contributions to the K matrix (see Figure 4.24). The same samples can also be
used to evaluate the Mij numerically if desired.
Although most of the algorithms described above will provide reasonable evalu-
ations of the form factor for most cases, they can suffer serious inadequacies in
the presence of singularities in the kernel. The singularity in the integrand for
equations 4.7 and 4.10 occurs when the two differential areas meet (i.e., r 0).
Potential difficulties are illustrated by an experimental comparison in which
three variations of numerical form factor algorithms were tested as before, but
this time on two unit squares at right angles with a shared edge (see Figure 4.25).
The test environment thus contains no transitions in visibility but does have a
region (along the shared edge) at which the kernel of the area-area integrand
becomes singular.
Results are shown in Figure 4.26. Although in all the algorithms the mean
tends toward an accurate answer, any single invocation of the Monte Carlo
method can return an extremely inaccurate answer due to the singularity. The
standard deviation is much less in the hemicube and Malleys method since the
area-hemisphere method removes the singularity analytically before the numer-
ical evaluation.
There are a number of other ways to deal with the singularities. If the
singularities in the kernel are guaranteed to occur only on the edges of the
elements (e.g., where a wall meets the floor), and the basis set is chosen to have
zeros of multiplicity 2 at its edges, then the singularity will disappear when
weighted by the basis function under the integral. One example of such a basis
is provided by the Jacobi polynomial set on the element parameterized by u and
v ranging from 1 to 1:
Although the numerator goes to zero as fast as the denominator, this of course
does not prevent a divide by zero in practice. One would need explicitly to
check for this condition. This option is not pursued further here. Details of this
approach can be found in [270].
Another solution is to move the quadrature point away from the singularity
by a small amount. In other words, if r is below some threshold, the quadrature
points are moved away from the intersection of the elements where the singu-
larity occurs. Care must be taken that the movement is inward on the elements.
Since there is no analytic justification for moving the points inward, the accu-
racy of the results will not converge to zero with large numbers of samples, but
the possible large errors incurred from hitting the singularity will be avoided.
Hybrid methods that handle singular regions analytically coupled with numer-
ical methods for the rest of the integral are also possible but have not been
extensively explored.
In point collocation, nodes on concave corners, such as on the floor where
it intersects the wall, will result in a form factor of zero for the intersecting
surface. In the case of a projection algorithm like the hemicube, this is because
the intersecting surface passes through the eye point and thus projects as a line
[163]. The form factor will be zero for other algorithms, since the cosine of the
angle with respect to the intersecting surface is zero. If that surface reflects a
significant amount of energy, a visible dark streak along the receiving surface
near the intersection may result. Moving the node inward may help in these
If more than one element is contained in a single leaf cell, the priority of these
must be established by some other means.
View Coherence
Although a hemicube requires projecting the scene onto five different image
planes, the five planes are obviously far from arbitrarily related. The hemicube
determines five orthogonal 90-degree view frustums. If the five planes are posi-
tioned to face in the +X, X, + Y, Y, and +Z directions (see Figure 4.27),
the coherence that arises from this arrangement provides several opportunities
for optimization.
Vilaplana and Pueyo [245] observe that once the elements have been trans-
formed to the view coordinates of the front face of the hemicube, they can
be rapidly transformed for the other faces simply by swapping coordinates and
changing signs appropriately. Given a coordinate x, y, z in the top faces view,
Vilaplana and Pueyo also suggest a way of accelerating the clipping that
must be performed against each of the five view frustums. The top view frustum
shares a clipping plane with each of the four side view frustums, and each of the
side frustums shares planes with two other side frustums. Vilaplana and Pueyo
describe a modified Sutherland-Hodgman clipping algorithm in which each edge
of each element is clipped against all five frustums in one pass (as well as against
the sixth horizon plane determined by the base of the hemicube). Vertices are
transformed into the view coordinates for the top face. Each vertex of an element
is then classified in turn by testing against the six clipping planes. The vertices,
including those created by clipping edges, are added to lists maintained for each
frustum. Following clipping, the vertices for each frustum are transformed as
above, projected onto the corresponding hemicube face, and scan-converted as
usual.
Hardware Z-Buffering
One inspiration for the original hemicube algorithm was the availability of hard-
ware depth-buffers to do the visibility determination. The basic approach to
using graphics acceleration is to specify a view for each face of the hemicube
and pass the elements down the hardware pipeline for scan-conversion and Z-
buffering. Instead of a color, an item ID is stored at each pixel, which identifies
the visible element. The ID can be generated by assigning each element a color
corresponding to its ID. The colors can then be read back from the frame buffer
and decoded, with the contribution due to the delta form factor at each pixel
computed in software as usual. This approach has been implemented by Baum
et al. [21] and others. Bu [39] also describes a hardware implementation for fast
form factor computation.
A similar approach is used by Recker et al. [191]. Instead of the hemicube,
Recker uses a single plane method, which requires that each element be pro-
jected, clipped and scan converted once rather than five times.
An interesting hardware alternative to the hemicube has been proposed by
Fuchs et al. [88] for the Pixel Planes 5 graphics engine. This algorithm computes
Nusselts analog directly, taking advantage of the ability of Pixel Planes 5 to
evaluate a quadratic expression at every pixel. Their estimated time to compute
form factors to 100,000 elements is 1 second.
One advantage of ray tracing for computing form factors is the wealth of acceler-
ation algorithms and data structures that are available. Bounding box hierarchies,
voxel grids, and octrees are all applicable to ray tracing for radiosity. 14
The rays used for form factor computations are generally shadow rays. Thus
they need only determine whether occlusion occurs or not, as opposed to de-
termining the closest intersection alone the ray. There are several specialized
tricks for accelerating shadow ray testing that are worthwhile looking at for ra-
diosity implementations [111]. Perhaps the simplest, shadow caching, is always
to test the ray against the most recently encountered occluding object, on the as-
sumption that an extended object will tend to intersect a number of neighboring
rays.
Directional acceleration schemes are particularly well suited to radiosity.
These take advantage of the coherence between rays leaving a particular region
of space in a particular set of closely related directions [11]. As has been seen,
computing the form factor from one element to another may require shooting
many rays between the two elements. These rays tend to have similar origins
and directions.
The shaft-culling algorithm described by Haines and Wallace [112] and by
Zhang [271] is intended to exploit this coherence. Haines and Wallace organizes
the objects of the scene into a bounding box hierarchy. Rays can always be
tested for an intersection by traversing this hierarchy starting at the root node.
Intuitively, however, if many rays are to be shot between two limited regions,
such as two elements, it is worth some effort to create a short candidate list of
objects for testing. Candidate objects are those that lie in the region of space
joining the starting and ending areas.
Haines and Wallace first construct a volume, or shaft, using planes to join the
bounding boxes of the objects or elements that define the endpoints of the rays.
The bounding boxes are constrained to be orthogonal to the world coordinate
axes. This allows a number of geometric and algebraic simplifications in the
construction of the shaft. An example is shown in Figure 4.28.
Once the shaft is created, it is tested against the bounding box hierarchy.
A box that is entirely contained within the shaft is added to the candidate list.
A box that partly intersects the shaft is usually opened up, and its sons tested
against the shaft recursively, in a depth-first manner. In some cases it may be
better to add the box on the candidate list without opening it up. A box that
is entirely outside the shaft is culled, and traversal of that branch of the tree is
ended. The final result is a candidate list of bounding boxes and objects.
14
The best introduction to this topic is Arvo and Kirks Survey of Ray Tracing Accel-
eration Technique in [97].
Figure 4.28: Shaft culling: first an axis aligned bounding box in constructed
around each polygon. Then a convex hull (or shaft) is constructed between pairs
of bounding boxes.
Shaft culling is potentially useful for occlusion algorithms other than ray
tracing. For example, the polygon contour clipping algorithm of Nishita and
Nakamae [175] could be accelerated using shaft culling to produce a candidate
list of polygons for clipping.
Marks et al. [160] describe an algorithm related to shaft culling in which the
object is to rapidly cull away empty portions of the volume connecting two
elements. The volume is subdivided recursively, with recursion stopping
when a volume becomes empty. After a certain subdivision limit is exceeded, the
remaining volumes are tested for occlusion using rays.
Teller and Hanrahan investigate incremental visibility algorithms that rapidly
preprocess the environment and categorize pairs of surfaces as fully visible to one
another, fully blocked, or partially blocked [232]. They also maintain a candidate
list of blocking surfaces between each pair. This preprocessed information then
greatly accelerates visibility calculations during form factor computation.
Chapter 5
|K
j =1
ij | | Kii |, i (5.4)
j i
This is strictly true for the radiosity problem with constant basis functions.
This can be seen by examining the matrix equation 5.3, in which the
diagonal terms are all equal to one. The sum of the form factors in any
row is by definition equal to unity, and in any physically realistic system
the reflectivity terms will be less than one. Thus, the off-diagonal terms
must sum to less than the diagonal term. The matrix will also be diagonally
dominant for general basis functions with local support.
The diagonal dominance of K ensures that particular iterative solution
methods such as Gauss-Seidel (described in section 5.3.2) will converge.
However, the diagonal dominance of rows should not be confused with the
diagonal dominance of columns, which does not characterize the current
form of K. This distinction will arise in the discussion of Southwells
method, described in section 5.3.3.
Spectral Radius: The spectral radius of a matrix is a particular type of
norm that describes the size of its largest eigenvalue. The detailed defi-
nition of these terms is beyond the scope of this text. The spectral radius
is an indicator of the speed with which iterative methods will converge.
Intuitively, one can see that as the reflectivity values approach unity (i.e.,
perfect reflectors), the system will require more iterations to converge.
Physically speaking the light will reflect about the environment more be-
fore being absorbed. Mathematically, the spectral radius is approaching
one.
If PF has a norm less than one, then K = [ I PF] is invertible, and the
Neumann series of successive multiplications of PF will converge to the
inverse.
If PF < 1 then K -1
= [ I PF ]
-1
= (PF)
a= 0
a
(5.5)
This property is also important for iterative methods such as Jacobi itera-
tion, which in essence mimics the Neumann series.
Condition: The condition number of a matrix describes how sensitive the
solution is to small perturbations in the input (as in the case the emission
terms). In general, the matrix arising in radiosity applications is well
conditioned, indicating that most solution methods are applicable.
KB = E (5.6)
containing the unknown vector, B, and an initial guess, B(0), the error, e(0)
defined to be equal to the difference between the actual answer B and the current
guess
Since the real answer B is not known, e cannot be measured directly. However,
one can define a residual, r(0), where
Clearly, if the residual is zero, then the solution guess is correct and the error
is zero as well. In contrast to the error, the residual is a quantity that can be
directly measured.
After each iteration2 of the solution process, the most recent guess and
residual, (B(k) and r(k)), are replaced by a more accurate guess and residual,
(B( k+1) and r( k+1)).
The initial guess, B(0), can influence the rate of convergence. In general,
an initial guess that is closer to the final solution will require fewer iterations.
If there is no information available upon which to base an initial guess, B(0)
can simply be a vector of zeros. For the radiosity problem the light source
radiosities are given a priori by E, and a better initial guess is B(0) = E since
light sources typically have zero reflection.
K Bj = E
j
ij i (5.9)
moving all but the ith term to the right hand side
Kii Bi = Ei K B
j i
ij j (5.10)
2
Superscripts (e.g., B(k)) will be used to indicate a complete iteration of the iterative
solution process. A superscript of zero indicates the state prior to the first iteration. An
iteration is distinguished from a step, which refers to the processing of one entry in B
during a particular iteration. A complete iteration will usually involve n steps. Subscripts
will be used to indicate position in the vector when necessary.
B(k )
Bi(k +1) = Ei K
j i
ij
j
Kii
(5.11)
With the definition of the residual vector (equation 5.8), this can be simplified
to adding the residual divided by the diagonal to the previous guess,
ri(k )
Bi(k +1) = Bi(k ) + (5.12)
Kii
Thus if the residual vector is known3 the full iteration (all n steps) can be
performed in linear time, O(n). Although each step in isolation would relax one
element of the residual if the old solution were still valid, none other than the first
element of B dealt with would actually result in zeroing out the corresponding
residual. Thus this is not, strictly speaking, a relaxation method. As with all
new guesses. It is this recursive nature of iterative methods that makes them
very sensitive to the characteristics of the system outlined above.
A close look at the Jacobi algorithm reveals its essential similarity to the
Neumann series described in section 5.1. Thus, it can be said with confidence
that this simple algorithm will converge to the correct solution in the case of the
radiosity problem.
5.3.2 Gauss-Seidel Iteration
Gauss-Seidel iteration is a slight variation of the Jacobi method. It provides
a true relaxation method and will usually improve the speed with which the
solution converges. At each step during an iteration, the Gauss-Seidel method
uses the most up-to-date version of the solution vector, rather than the solution
vector computed by the previous iteration. Thus, at each of the n steps of an
iteration, the new entry of B is computed using the values B(k+1) computed by
previous steps of the current iteration. Otherwise, values computed during the
previous iteration B(k) are used. Thus, to relax ri, set
i 1 +1) n
B(k B(k )
Bi(k +1) = Ei K
j =1
ij
j
Kii
K
j =i +1
ij
j
Kii
(5.13)
3
Although Jacobi iteration is not often used on its own since more efficient methods
are known, it will become clear in later sections how one can take advantage of the
known residual vector to increase the power of other algorithms.
Performing the step for a single entry of B requires taking the dot product
of the current guess, B(k),(k+1), with a row of the matrix, and thus requires
O(n) operations. Consequently, a full iteration consisting of n steps is O(n2).
Alternatively, since
n
ri(k ) = Ei K B
j =0
ij
(k )
j (5. 14)
if all the residuals are updated after each step, one can set
ri(k )
Bi(k +1) = Bi(k ) + (5.15)
Kii
In this case the cost of a step is reduced to O(1), but the residual update will
be O(n) for each step and a full iteration is again O(n2). Essentially, these
operations are equivalent to the operations in equation 5.12.
Examining a single step in the Gauss-Seidel algorithm (line 4), a single nodal
radiosity value, Bi, has been selected to update by summing contributions from
all other radiosity values weighted by the reflectivities and form factors in the
ith row of K. Assuming constant elements, each term of summation in line 5
can be expanded using the K matrix (equation 5.3) entries and taking advantage
of the fact that Kii = 1 if elements cannot see themselves. Thus
B j Kij
For i, such that ri = Max(r) : Bi = Ei (5.17)
j i
Kii
K ji
r (j p+1) = r (j p) ri( p) , j (5.21)
Kii
1 for (all i ) {
2 Bi = 0 ;
3 ri = Ei ;
4 }
5 while ( not converged ) {
6 pick i, such that |ri| is largest ;
7 Bi = Bi + ri / Kii ;
8 temp = ri ;
9 for ( all j ) rj = rj Kji/Kii * temp ;
10 }
11 output B ;
Each step of the Southwell algorithm does two things. It updates one element
of the radiosity vector, Bi, and updates all of the residuals. If constant bases
are used, the physical interpretation of B is the vector of nodal radiosity values
and thus the radiosity of each element. What is the physical interpretation of the
residuals, r? The residuals are the unshot radiosity of each element. In other
words, the residuals represent the radiosity that has been received as illumination
by the elements but has not yet been reflected or shot back out to contribute
further to the illumination of the environment.
It is clear from equation 5.22 that each step takes one residual and adds
fractions of it to each of the others. The specific fractions are the ith column of
Ai
r (j p+1) = r (j p) + r j F ji ri( p) = r (j p) + r j Fij ri( p) (5.24)
Aj
or rearranging,
rj(p+1) Aj = rj(p) Aj + rj Fij ri(p) Ai for each residual rj (5.25)
shows that the total unshot energy (radiosity 3 area), is reduced in each step
since both the r and the sum of the Fijs are less than one.
Progressive Refinement
Cohen et al. [59] describe a slightly different form of Southwells algorithm,
called progressive refinement or progressive radiosity. The goal of progressive
refinement is to display results after each step of an iterative process, in order
to provide immediate feedback. The requirement is thus not only to provide an
algorithm that converges quickly, but one that makes as much progress at the
beginning of the algorithm as possible. In progressive refinement the flow of
the traditional radiosity approach becomes an iterative repetition of the steps of
1 for ( all i ) {
2 Bi = Ei ;
3 Bi = Ei ;
4 }
5 while ( not converged ) {
6 pick i, such that Bi * Ai is largest ;
7 for ( every element j ) {
8 rad = Bi * rjFji ;
9 Bj = Bj + rad ;
10 Bj = Bj + rad ;
11 }
12 Bi = 0 ;
13 display the image using Bi as the intensity of element i ;
14 }
computing form factors, performing steps of the solution and displaying inter-
mediate results (see Figure 5.4). For constant elements, the progressive radiosity
algorithm follows the pseudocode in Figure 5.6.
The previous algorithm has the following physical interpretation. All el-
ements i have a value Bi, which is the radiosity calculated so far for that
element, and Bi which is the portion of that elements radiosity that has yet
to be shot. During one iteration, the element with the greatest unshot radiosity
is chosen and its radiosity is shot (see Figure 5.5) through the environment. As
result of the shot, the other elements, j, may receive some new radiosity,
rad. This rad is added to Bj. rad is also added to Bj since this newly
received radiosity is unshot. As a result of the shooting, element i has no unshot
radiosity, so Bi = 0.
In this algorithm one shooting step (lines 711 in Figure 5.6) updates all
the other elements. Energy is shot from the element that currently has the most
unshot radiosity. One shooting step takes O(n) operations and can be viewed
multiplying the scalar Bi by a column of the form factor matrix. Cohen et
al. [59] show that in many cases only a small fraction of n shooting steps is
required to approximate a solution closely.
At first glance Southwell and progressive refinement seem to be quite dif-
ferent. Southwell updates only one entry in B, while progressive refinement
updates them all at each step. However, recognizing B in the progressive refine-
ment algorithm to be the sum of B and r of the Southwell algorithm, the two
algorithms are in fact almost identical. There is one other difference: progres-
sive refinement selects the largest energy to shoot (i.e., the largest ri Ai) rather
than simply the largest residual. The use of the sum of the already shot radiosity
and the unshot residual to be the current answer can be explained as a hybrid of
Southwell and Jacobi iteration. This sum is exactly equivalent to the Southwell
algorithm followed by one full iteration of Jacobi iteration before display.
It should be clear why this algorithm should converge faster than a Gauss-
Seidel algorithm, particularly in the early steps (see Figure 5.7). The Southwell
and progressive refinement algorithms make very good guesses about which el-
ement of the residual vector to relax to get the greatest reduction in the residual
as a whole. Particularly at the start of the iterations, all the unshot energy resides
in the light sources (i.e., only a few emission terms are nonzero) thus there a
only a few nonzero residuals. As the light interreflects about an environment,
the unshot energy (i.e., residuals) becomes more evenly spread out and thus the
advantage of selecting the largest to process is reduced as the algorithm pro-
gress. A full analysis and proof of convergence properties of these algorithms
for the radiosity problem can be found in Gortler et al. [101].
ri Ai
B = (5.26)
Ai
Each time some of this unshot radiosity is processed in a step of the progressive
refinement algorithm, some of that energy is absorbed, but some of it is returned
to the unshot quantities of other elements (or basis functions). On average, with-
out knowing in advance where the unshot energy will arrive, one can estimate
6
In the case of nonconstant basis functions, the area is the integral of the basis function
dotted with itself.
that some fraction of the energy will be reflected. This fraction is represented
by r ,where
r i Ai
r= (5.27)
Ai
Of course, in the same way that some of the shot energy is reflected, some of
the reflected energy will be rereflected and so on. The total reflection, Rtotal,
can be represented by the infinite sum
1
Rtotal = 1 + r + r 2 + r 3 + .... = (5.28)
1 r
Finally, the product of the average unshot radiosity, B , and the total reflection
gives us an estimate for the ambient radiosity, B ambient:
Each element i will reflect its own fraction ri of this quantity. Thus for display
purposes only (see Figure 5.8)
p 2
(Bi Bi ) Ai
100 (5.31)
Ai
ri(k )
Bi(k +1) = Bi(k ) + v (5.32)
Kii
and the ith residual being relaxed is now not set to zero, but rather,
NumLights
B =
L =1
EL B L (5.34)
where EL= the emission of Lth light source, and BL = the radiosity solution
vector computed using the emission vector set to 1 for Lth light source and 0
elsewhere.
This provides a very rapid means of changing between lighting settings.
Dorsey [73] has gone one step further in her opera lighting design system by
prerendering multiple images of complex scenes from a fixed viewpoint, differ-
ing only by the light emissions (color plates 53, 54 and the back cover). By
Figure 5.10: A dynamic environment with bounding box around all positions of
moving object.
scaling and summing the images themselves, different lighting conditions can be
set at interactive rates. (More details of the rendering step and this application
can be found in Chapters 9 and 11). If the cost of inverting K is undertaken,
then the radiosities B due to any emission vector E can be solved by a simple
matrix-vector multiplication, K1 E = B.
r new
j r old
j
B j = Bj (5.35)
r old
j
Clearly, this will not work in the case of surfaces that were originally defined
as black (i.e., pjold = 0).
Figure 5.11: A dynamic environment: (a) initial solution, (b) after shooting
negative energy to table top, (c) after shooting positive energy with airplane in
new position.
single object, or the addition (or removal) of a new object, has the potential to
change any entry in K. However, if it is assumed that only small changes are
made, there are a number of acceleration methods that have been described and
demonstrated.
Baum et al. [20] describe a method that can be used when all changes in the
positions of any objects are known in advance of any form factor computation.
In this, case, a bounding object can be constructed for each dynamic object. The
bounding box contains the volume swept by the object as it moves along the path
(see the airplane in Figure 5.10). During form factor computation, form factors
are marked if their visibility is affected by the composite bounding box. Thus,
at subsequent points in time only marked form factors need to be recomputed
before a new solution is performed.
Chen [51] and George et al. [91] do not assume a priori knowledge of ob-
networked workstations [186, 191], to transputer arrays [46, 107, 188] to the
thousands of processors on SIMD machines such as the CM2 [77] and MasPar
[240]. Other reports describe theoretical analyses of possible algorithms [244].
Methods can be grouped according to where and how they exploit the natu-
ral parallelism in the algorithms. The computation of form factors is the primary
bottleneck in the radiosity algorithm, and it is on that step that most implemen-
tations have concentrated. In [46, 50, 81, 107, 190] several full rows of form
factors are computed in parallel. Each processor performs a single hemicube or
other form factor quadrature and reports the results to another processor which
uses the results for the next step in an iterative solution (see Figure 5.12). An
additional processor may be devoted to displaying the current state of the radios-
ity solution. In a finer grained approach, individual form factors are parceled
out to processors in [21, 95]. There are also many implementations of parallel
ray tracing which can be used at an even finer level within a single form factor
computation. Drucker and Schrder [77] exploit parallelism at many levels in
their implementation on the Connection Machine.
Each of the reports offers insights into the many subtleties that arise when
using and implementing parallel strategies. The reader is encouraged to seek
out these references for a fuller understanding of the algorithms and reports of
experiments on a variety of environments.
Chapter 6
Domain Subdivision
As described in Chapter 3, the approximation of the radiosity function, B(x),
is a fundamental step in the discretization of the radiosity equation. The ap-
proximation, B (x), is defined by the linear combination of n basis functions,
Ni (x):
n
B(x) B(x)
= B N (x)
i=1
i i (6.1)
The basis functions define a finite subspace of functions from which the approx-
imation B (x) is realized by choosing the coefficients, Bi.
In a finite element approximation, each of the basis functions, Ni (x), has
local support; in other words, each is nonzero over a limited range of the function
domain. A basis function is associated with a single node and has a value of
zero outside of elements adjacent to the node.
As discussed in Chapter 3, each type of basis function is defined with respect
to a generic element, such as the unit square. The generic basis functions are
then mapped to the actual model geometry according to the subdivision of the
surfaces into elements. Thus, the form of any particular basis function is tied to
the placement and size of one or a few elements. The total set of basis functions
defining the approximation is thus determined by the mesh of elements and
nodes.
The next three chapters will describe strategies and algorithms for subdi-
viding the domain of the radiosity function into finite elements, with the goal
of producing an efficient and accurate radiosity solution. The accuracy of the
approximation, B (x), is influenced by the size, shape and orientation of the
elements, as well as by the polynomial order of the basis functions. An optimal
mesh uses as few elements as possible to achieve a desired accuracy, which
generally means distributing errors in the approximation as evenly as possible
among the elements.
To achieve a high quality mesh, it is first necessary to be able to measure the
accuracy of the approximation produced by a particular subdivision and choice
Of course, equation 6.5 cannot be evaluated directly, since B(x) is not known.
Instead, (x) must be estimated. Several error estimator are described in the
following sections. Particular implementations of these approaches for radiosity
will be described in section 6.3.3.
where the basis functions, Ni(x), are of order k, to a higher order approximation
n
B(x) = B N (x)
i=1
i i (6.7)
where the new basis functions, N i (x), are of order k + 1 or greater. For example,
if B (x) is constructed using linear basis functions, the error can be estimated
by comparing B (x) to an approximation B (x) constructed using a quadratic or
cubic basis. The error estimate (x) is then given by
r(x) = B (x) E(x) S (x) G(x, x(x)) B (x) dA (6.9)
1
For exceptions and valuable discussions of this issue, see [238] and [250]. Subjective
brightness and image display are discussed at length in Chapter 9.
(see Figures 6.2 through 6.4) to illustrate the related issues of mesh quality,
approximation error and visual quality.
6.2.1 An Example
The images in this series compare a radiosity solution to a correct,, reference
image. The model is a simple L-shaped room illuminated by a single, diffusely
emitting area light.
The image in Figure 6.2 shows a radiosity solution on a uniform mesh of
linear elements performed using point collocation and rendered with Gouraud
interpolation. The solution was performed for direct illumination only (i.e.,
interreflected light was ignored). The form factors to the light source were
computed at each mesh node by shooting 256 rays to randomly selected points
on the light polygon.
The reference image (see Figure 6.3(a)) was computed by similarly eval-
uating the form factor to the light at the surface point visible at the center of
each image pixel. Since the contribution of the light source has been evaluated
similarly in both the radiosity and reference images, the difference between the
two images is essentially due to the approximation created by the element mesh.
Numerous artifacts introduced by the approximation are evident, including
blocky shadows (letter A of Figure 6.3(b)), missing features (letter B), Mach
Figure 6.3:
bands (letter C), inappropriate shading discontinuities (letter D), and unresolved
discontinuities (letter E).
Figure 6.4 is a visualization of the RMS error (defined in the box on function
norms on page 133) for each element. The error was computed by evaluating
the radiosity at 16 interior points across each element and comparing this to
the approximate value. The comparison shows absolute as opposed to relative
error. As apparent in this image, the error in the approximation is very unevenly
distributed over the mesh. Computational effort has been applied fairly equally
over the domain of the approximation, with very unequal contributions to the
resulting accuracy.
The example shown in these images will be referred to throughout this
chapter, to illustrate the discussion of meshing strategies. That discussion will
begin with the description of basic mesh characteristics in the following sections.
Figure 6.6: A radiosity solution with the mesh density increased four times over
the mesh used in Figure 6.2.
quality is better and some of the artifacts are almost eliminated. However,
the corresponding error image in Figure 6.7 shows that the extra effort has been
applied inefficiently, with many elements subdivided where the error was already
negligible. This effort would have been better expended in further reducing the
error in the remaining problem areas, such as along the shadow boundaries.
2
The notation Ck indicates that a function is continuous in all derivatives up to and
including k. C0 thus indicates that a function is continuous in value (i.e., there are no
sudden jumps in value), C1 that the function is continuous in slope (i.e., there are no
kinks), and C that the function is smooth (i.e., continuous in all derivatives).
Aspect Ratio
Element shape affects the efficiency with which the mesh samples the radiosity
function [18]. To make the most efficient use of a given number of nodes, the
nodes should be evenly distributed over the domain of the function (assuming
that the behavior of the function is unknown). A distribution of nodes that is
denser in one direction than in another is inefficient, since if elements are subdi-
vided far enough to make sampling adequate in the sparse direction, sampling in
the denser direction will be greater than necessary. Poor element shape can also
affect the accuracy or efficiency of numerical integration of the form factors.
A reasonably uniform distribution of nodes can be obtained by requiring
elements to have as high an aspect ratio as possible. The aspect ratio is defined
as the ratio of the radius of the largest circle that will fit completely inside the
element to the radius of the smallest circle that will fit completely outside the
element (see Figure 6.12) [18]. This ratio should be as close to 1 as possible.
However, if the behavior of the function is known, anisotropic sampling
may be more efficient than a uniform distribution, since the function changes
more slowly in the direction orthogonal to the gradient and thus fewer samples
are required along that direction. Elements with a lower aspect ratio may be
more efficient in this case, if oriented correctly.
Form factor algorithms may make assumptions that are violated by elements
with poor aspect ratios. For example, in the adaptive ray casting algorithm
described by Wallace et al. [247], (see Chapter 4), elements or pieces of elements
(delta-areas) are approximated as disks. The accuracy of the disk approximation
decreases with decreasing element aspect ratio.
Figure 6.12: The effect of aspect ratio on sampling density. A low aspect ratio
tends to produce an anisotropic sampling density.
Mesh Grading
A nonuniform, or graded, mesh may be required to distribute the error evenly in
the approximation. In a well-graded mesh, element size and shape vary smoothly
in the transition between regions of higher and lower density (see Figure 6.14).
Abrupt changes in size or shape will often cause visible irregularities in shading,
since neighboring elements will approximate the function with slightly different
results. Because of the eyes sensitivity to contrast, such differences may be
visible even when the error for both elements is within tolerance.
Mesh Conformance
It is important that adjacent elements conform across shared boundaries, as
shown in Figure 6.15. Discontinuities in value created by nonconforming ele-
ments can cause distinctive image artifacts. Conforming elements share nodes
Figure 6.13: (a) A surface approximation based on a regular subdivision. (b) The
same surface approximated using elements with poor aspect ratios but oriented
so as to provide a better approximation, (after Schumaker, 1993).
Figure 6.14: The top mesh shows a poorly graded transition between regions of
high and low mesh density. The bottom well-graded mesh provides a smoother
transition.
6.2.5 Discontinuities
If light sources have a constant emission value (or are C ) across the surface
and if changes in visibility are ignored, then the radiosity function B(x) across a
receiving surface will be continuous in all derivatives (i.e., it will also be C ).
This is evident from the form factor kernel, G(x, x), which itself is C except
where the visibility term V(x, x) changes from one to zero, and at singularities
where x and x meet and the denominator goes to 0.
If changes in visibility (i.e., shadows) are included, the radiosity function can
contain discontinuities of any order [121]. Discontinuities in value and in the first
and second derivatives are the most important, since these often provide visual
cues to three-dimensional shape, proximity, and other geometric relationships.
Much of the image processing performed by the eye involves enhancing such
discontinuities and, as a result, the failure to reproduce discontinuities correctly
can degrade image quality dramatically.
Figure 6.16: Shadows can cause 0th, 1st, 2nd, and higher-order discontinuities
in the radiosity function across a surface.
Value Discontinuities
Discontinuities in the value of the radiosity function occur where one surface
touches another, as at letter a of Figure 6.16. In Figure 6.17 the actual radiosity
function is discontinuous in value where the wall passes below the table top. The
shading should thus change abruptly from light to dark at the boundary defined
by the intersection of the wall and the table. Unfortunately, the boundary falls
across the interior of elements on the wall. Instead of resolving the discontinuity,
interpolation creates a smooth transition and the shadow on the wall appears to
leak upwards from below the table top.
Incorrectly resolved value discontinuities can also cause light leaks, in
which interpolation across one or more discontinuities causes light to appear
where shadow is expected. In Figure 6.18, for example, elements on the floor
pass beneath the wall dividing the room. The resulting light leak gives the
incorrect impression of a gap between the wall and the floor. The problem
is compounded when these elements incorrectly contribute illumination to the
room on the left, which is totally cut off from the room containing the light
source.
Derivative Discontinuities
Discontinuities in the first or second derivative occur at penumbra and umbra
boundaries (letter b of Figure 6.16), as well as within the penumbra. When mesh
elements span these discontinuities, interpolation often produces an inaccurate
and irregular shadow boundary. The staircase shadows in Figure 6.2 are an
example.
Singularities in the first derivative can also occur, as at letter c of Figure 6.16
where the penumbra collapses to a single point. Tracing along the line of
intersection between the two objects, an instantaneous transition from light to
dark is encountered at the corner point. The first derivative is infinite at that
point, although the function is continuous away from the boundary.
The correct resolution of discontinuities requires that they fall along ele-
ment boundaries, since the approximation is always C on element interiors.
Thus, discontinuity boundaries must either be determined before meshing or the
mesh must adapt dynamically to place element edges along the discontinuities.
Since discontinuities may be of various orders, interpolation schemes that can
enforce the appropriate degree of continuity at a particular element boundary are
also required. Techniques for finding and reconstructing discontinuities will be
discussed in detail in Chapter 8.
3
Although user intervention can be helpful in constructing a mesh, the discussion
in this chapter will be limited to automatic mesh generation. Meshes for engineering
applications are still often constructed with some interactive help, but good results require
an experienced user who understands the underlying principles of the analysis. In image
Figure 6.19: The polygonal facets representing the curved surface in this image
were meshed independently. The resulting elements are nonconforming at the
facet boundaries, causing shading discontinuities.
Figure 6.20: The facets in this image were connected topologically prior to
meshing, and the surface was meshed as a unit.
synthesis the analysis of illumination is typically not the users primary task, and the
detailed specification of a mesh is intrusive and often beyond the users expertise.
Each of these approaches addresses one or more of the basic mesh characteristics
discussed earlier: mesh density, basis function order, and element shape. Radios-
ity algorithms have so far relied almost exclusively on h-refinement. However,
the other approaches will also be briefly described here, partly to indicate pos-
sible directions for radiosity research. See Figure 6.22 for illustrations of these
approaches.
R-refinement
In r-refinement the nodes of the initial mesh are moved or relocated during
multiple passes of mesh relaxation. At each pass, each node of the mesh is
moved in a direction that tends to equalize the error of the elements that share the
node. (See section 8.4 for a basic algorithmic approach to moving the vertices.)
The function is then reevaluated at the new node locations. Relaxation can
continue until the error is evenly distributed among the elements.
R-refinement has the advantage that the mesh topology is not altered by
the refinement, which may simplify algorithms. It generates an efficient mesh,
in that it minimizes the approximation error for a given number of elements
and nodes. On the other hand, r-refinement cannot guarantee that a given error
tolerance will be achieved. Since the number of elements is fixed, once the error
is evenly distributed it cant be lowered further. Also, care must be taken during
relocation not to move nodes across element boundaries. It may furthermore be
difficult to maintain good element shape near fixed boundaries.
H-refinement
In h-refinement, the local error is decreased by increasing the density of the
mesh; elements with a high error are subdivided into smaller elements. (The
h refers to the symbol commonly used to characterize element size in finite
element analysis.) The function is then evaluated at the new nodes. Since
new nodes are added, the approximation error can be made as small as desired
(although this may not always be practical). Elements and nodes can also be
removed in regions where the approximation error is lower than necessary. In
some h-refinement algorithms, refinement does not require reevaluation of the
function at existing nodes.
P-refinement
In p-refinement, the approximation error is reduced by increasing the order of the
basis functions for certain elements. (The symbol p refers to the polynomial
order of the basis functions.) New nodes are added to the affected elements,
but the element shape and the mesh topology are not otherwise changed. In
contrast to h-refinement, the number of elements in the mesh is not increased,
which limits computational costs in some ways. However, the function must be
evaluated at additional nodes, and the higher-order basis functions can be more
expensive to compute. As with h-refinement, the ability to change element
shape or orientation is restricted. Care must also be taken to maintain continuity
between adjacent elements having basis functions of different orders.
Remeshing
Remeshing algorithms modify both the node locations and mesh topology; in
essence the existing mesh is completely replaced. This allows complete flexibil-
ity of element shape and orientation, as well as the ability to decrease arbitrarily
the approximation error. Following remeshing, the function must be reevaluated
at the nodes of the new mesh.
Hybrid Methods
Hybrid refinement methods can be constructed by combining the above basic
approaches. For example, r-refinement works best when it begins with a mesh
that is reasonably well refined, since relaxation cannot reduce the local error
beyond the minimum achievable with the initial number of nodes. A potentially
useful hybrid strategy might thus use h-refinement to achieve a reasonable initial
sampling density and r-refinement to more evenly distribute the approximation
error.
Figure 6.24: Error image for adaptive subdivision. Compare to Figures 6.4 and 6. 7.
Adaptive_Subdivision( error_tolerance ) {
Create initial mesh of constant elements ;
Compute form factors ;
Solve linear system ;
do until ( all elements within error tolerance
or minimum element size reached ) {
Evaluate accuracy by comparing adjacent element radiosities ;
Subdivide elements that exceed user-supplied error tolerance ;
for ( each new element ) {
Compute form factors from new element to all other elements ;
Compute radiosity of new element based on old radiosity values ;
}
}
}
elements. The corresponding error image is shown in Figure 6.24. Note that
even with adaptive subdivision, the error remains high for elements lying along
the shadow boundary.
Cohen et al. [61] first applied adaptive subdivision to radiosity meshing,
using the algorithm outlined in the pseudocode in Figure 6.25. For clarity, this
outline ignores the hierarchical nature of the adaptive subdivision algorithm,
which will be discussed in detail in the following chapter. For now, note only
that new nodes created by adaptive subdivision have their radiosities computed
using the approximation B (x) obtained during the initial solution. As a result,
it is not necessary to recompute radiosities for existing nodes when an element
is subdivided.
Many variations of this basic approach have been developed differing pri-
marily in how they estimate error, and how elements are subdivided. The fol-
lowing sections will survey adaptive subdivision algorithms and how they have
addressed these two issues.
Figure 6.26: Cohens subdivision criterion based on the difference between nodal
values results in the subdivision of element A, although linear interpolation pro-
vides a good approximation in this case. (Added nodes due to the subdivision
are indicated by hollow circles.) The local minimum at D is also missed.
[61] compare the radiosities of an element and its neighbors . If these differ in
value by more than a user-specified tolerance, the element is subdivided. For the
constant elements, this is essentially equivalent to estimating the local error by
comparing the piecewise constant approximation to linear interpolation through
the same nodes and nodal values.
For rendering, however, Cohen uses linear interpolation. With respect to
linear interpolation, this subdivision criterion is better characterized as a heuristic
designed to produce smaller elements in regions where the radiosity is highly
variable. This heuristic usually produces acceptable results, although it tends to
oversubdivide where the gradient is high but constant. Since linear interpolation
is a reasonable approximation for this case, subdividing has little effect on the
error (see Figure 6.26.)
This heuristic may also fail to identify elements that should be subdivided.
In Figure 6.26 the nodes bounding an element containing a local minimum (letter
D in the figure) happen to have almost the same value. The heuristic fails in this
case, since the nodal values alone do not provide enough information about the
behavior of the function on the element interior. This difficulty is common to all
types of error estimators and algorithm make efforts of varying sophistication
to characterize the function between nodes.
For example, Vedel and Puech [242] use the gradient at the nodes as well as
the function value. Elements are subdivided if the gradients at the element nodes
vary by more than a certain tolerance (see Figure 6.27). This criterion avoids
subdividing elements unnecessarily where the gradient is high but constant (letter
A of Figure 6.27). It may also detect a local minimum within an element whose
nodal values happen to be similar (letter B of Figure 6.27). However, the
criterion is not foolproof. Letter C of Figure 6.27 shows a situation that might
occur when a penumbra falls entirely within an element. The gradients at the
nodes spanning the element happen to be equal and the element is not subdivided.
A more stringent criterion can be constructed that uses both the nodal values
and gradients. An algorithm based on this approach might first compare gradi-
ents at the nodes. If the gradients vary by too much, the element is subdivided.
Otherwise, the gradient at the nodes is compared to the slope of the plane deter-
mined by the nodal values. If they are inconsistent, the element is subdivided.
This criterion correctly identifies the element at letter C in Figure 6.27, although
it does not identify the case indicated by the letter D.
changing very rapidly, for example, where the element contains a sharp shadow
boundary. In this case, the simple comparison of values does better, although
as expected, it tends to oversubdivide in other regions. Vedel and Puech con-
clude that the complexity of the bicubic method is not justified, and they suggest
simply comparing both radiosities and gradients.
Figure 6.29). The error at the centroid is assumed to be the maximum error
for the element. This approach can thus be viewed as estimating the L norm.
This technique is independent of the interpolation order (quadratic interpolation
was used by Lischinski et al.).
Of course, evaluating the error at the centroid is not guaranteed to catch
every case. In Lischinskis implementation, mesh boundaries corresponding to
discontinuities in the radiosity function or its derivatives are specified a priori.
Thus, a posteriori adaptive subdivision is required to refine the mesh only within
regions over which the radiosity function is relatively smooth and well behaved,
in which case checking the error at the centroid will generally produce good
results.
Campbell [42] describes a more systematic approach to determining the
behavior of the function on the interior. This is particularly useful when the
radiosity function cannot be assumed to be smooth. Campbells criterion for
subdivision uses the difference between the maximum and minimum radiosities
over the entire element, not just at the nodes. Elements that require subdivision
are split perpendicularly to the line connecting the maximum and minimum
points. Thus, Campbell's algorithm depends on a systematic search for the
extrema, which is achieved using standard optimization techniques.
Since Campbell's algorithm computes shadow boundaries a priori, it can
identify fully lit regions and treat them differently from penumbra regions, which
are more complex. For fully lit regions Campbell computes the gradient at the
nodes analytically by differentiating the point-polygon form factor equation.
This allows the use of optimization techniques that take advantage of gradient
information to accelerate the search. In addition, for a fully lit region there
can be only one local maximum on the interior of the element due to a given
constant diffuse source.
For regions within the penumbra the gradient cannot be computed analyti-
cally and no assumptions can be made about the number of local extrema. In
this case global optimization is performed using the Multistart method. A grid
is laid over the region and the function is evaluated at a random point inside
each grid cell. Cells whose neighbors are either all greater or all lesser in value
than the cell itself provide the starting point for local optimization.
None of the error criteria that have been described in these sections can guar-
antee that small features will be found. This is one advantage of discontinuity
meshing (discussed in Chapter 8), which locates critical shading boundaries a
priori based on the model geometry. Within regions bounded by discontinuities,
the radiosity function is reasonably well behaved, and simple error estimators
are more reliable.
where xi and xi1 are neighboring nodes. Central differencing can also be used,
given by
B B(x i +1 ) B(x i 1 )
= (6.11)
x x i +1 x i 1
If the mesh is irregular, the tangent plane at the node can be estimated using a
least-squares fit of a plane to the values at the node and its immediate neighbors.
(The contouring literature is a good source for techniques of this kind [257].)
The accuracy of these techniques depends on the spacing between nodes.
Figure 6.30: Two different subdivisions of the same element. The upper right
subdivision does not reduce the overall error of the approximation.
elements, but the actual reduction in error will depend~ on how the elements are
subdivided. For example, in Figure 6.30, two ways of subdividing an element
are compared. In one case, the error is reduced significantly, while in the other
it is not reduced at all.
Subdividing intelligently requires some estimate of the behavior of the func-
tion inside the element. Campbells optimization approach, described in the
previous section, is one of the few algorithms that attempts to obtain and use
this information. Campbell searches for the maximum and minimum points
on the interior of the element. The element is then subdivided on a bound-
ary perpendicular to the line connecting the maximum and minimum points.
The flexibility required to subdivide in this way places demands on the actual
subdivision algorithm. Campbell chooses a BSP-tree based approach for this
reason.
Airey [5] and Sturzlinger [227] note a useful technique for the special case
of subdividing rectangles into triangles. The edge created to split the rectangle
should connect the nodes with the most similar radiosities, since this produces
the greatest reduction in the variation between the nodes of each of the resulting
elements. Schumaker [207] discusses a generalization of this approach in which
the behavior of the approximation is incorporated into the quality metric used
during triangulation of the set of nodes. This more general approach has not yet
been applied to radiosity, however.
In the absence of knowledge about the function behavior, the best that can
be done is to subdivide uniformly. This is the approach taken by most existing
adaptive subdivision algorithms. The resulting subdivision will depend on the
particular subdivision algorithm. One common approach is to subdivide ele-
ments into four similarly shaped elements, generating a quadtree subdivision
hierarchy. If the elements are triangles, another approach is to subdivide ele-
ments, by inserting nodes and adding new edges. These and a wide variety of
other subdivision algorithms are surveyed in Chapter 8, with some discussion
of how they can be applied to adaptive subdivision.
Chapter 7
Hierarchical Methods
The meshing strategies surveyed in the previous chapter are designed to reduce
the computational cost of the radiosity solution by minimizing the number of
elements in the mesh. The solution cost depends strongly on the number of
elements, since solving the discrete radiosity equation requires computing an
interaction between every pair of elements. Thus, the cost of the radiosity
solution appears to be inherently O(n2) in the number of elements. Each of these
O(n2) relationships involves evaluating the form factor integral (the subject of
Chapter 4) and is thus expensive to compute. Hence, the goal of the meshing
strategies outlined in the previous chapter is to minimize the number of elements
while maintaining accuracy.
The subject of this chapter is an alternative approach to reducing the com-
putational cost of the radiosity algorithm. This approach keeps the same number
of elements, instead attempting to reduce the number of individual relationships,
or form factors, that have to be computed. For example, two groups of elements
separated widely in space might reasonably have the total interaction between all
pairs of individual elements represented by a single number computed once for
the entire group. Attaining this goal involves developing a hierarchical subdi-
vision of the surfaces and an associated hierarchy of interactions. The hierarchy
will provide a framework for deriving interactions between groups of elements,
which will result in computing many fewer than O(n2) interactions. In fact,
it will turn out that only O(n) form factors are required to represent the linear
operator K to within a desired error tolerance.
This chapter is divided into three major sections. The first two sections
describe hierarchical subdivision techniques that minimize the number of form
factors to be computed by grouping elements together. The first section assumes
that constant basis functions have been selected to approximate the radiosity
function. The section begins with a description of a two-level, patch-element
hierarchy and continues with the generalization of the basic hierarchical ap-
proach, resulting in an O(n) algorithm. The second section then describes an
alternate way of approaching the same goal, in which the hierarchical algorithms
are derived in terms of hierarchical basis functions. One such class of basis func-
tions, known as wavelets, will be used to represent the kernel of the radiosity
function at variable levels of detail. This formulation will provide a framework
for incorporating higher order basis functions into hierarchical algorithms.
The third section of the chapter introduces an adjoint to the radiosity equa-
tion that allows the importance of a particular element to the final image to
be determined. The combined radiosity equation and its adjoint will provide
yet another means to reduce greatly the computational complexity for complex
environments, in the case where only one, or a few, views are required.
I. Hierarchical Subdivision
size from a receiver, it is reasonable to average the source radiosity before the
integration step.1 For radiosity, this means replacing several form factors with
a single form factor.
On the other hand, when the table top is eventually rendered in an image,
its shading must capture all the details of the light and shadows falling on it.
These details will be lost if the effect of illumination arriving at the table is
averaged over a large area rather than computed in detail for smaller regions.
Thus, the radiosity of a particular surface or group of surfaces will have to be
represented at at least two levels of detail: coarsely when the surface acts as a
source of illumination and more finely when it acts as a receiver. There is no
inherent limitation to two levels, and these notions will be extended in a later
section to a generalized hierarchical representation.
1. Divide the surfaces into m patches and n smaller elements (m << n),
where each patch is composed exactly of the union of some subset of
the elements. The patches will act as the sources or shooters and the
elements will act as the receivers or gatherers. The patches are indexed
by i or j and the elements by q.
2. Compute the m n form factors from each element to each patch. A
single entry from element q to patch j would be Fqj.
3. Compute the m m form factors between pairs of patches directly from
the element-to-patch form factors by summing the form factors for the
1
A similar observation enables the use of a local reflection model to approximate the
complex interactions of light with the microscopic geometry of a surface.
F
Aq
Fij = qj (7.1)
qi
Ai
4. Solve the m m system of equations using Gauss-Seidel to get the patch
radiosities:
m
Bi = Ei + i B F
j=1
j ij (7.2)
2
A quadtree is the two-dimensional analog to a binary tree (i.e., each node in the tree
has four children and one parent).
Figure 7.4: Two flatland surfaces and the upper right quadrant of K. The value
of the entry 2, 10 represents the transport of light from element 10 to element 2.
and that are thus widely separated. According to the behavior of the function G
just described, these entries will be smaller and change less rapidly than those
in the lower left-hand corner of the quadrant, which represent elements that
are closer together. This is demonstrated very clearly in Figure 7.5, which is
a visualization of the upper right quadrant of a 32 by 32 matrix for the same
model.
Returning to the 16 by 16 example, the entries K2,9 and K2,10 , which
neighbor each other on row 2, represent the effect of elements 9 and 10 on
Figure 7.5: Value of entries in the upper right quadrant of the operator K. The
values indicated by the area of the circles.
element 2. If the values of these two entries are almost the same, a single value
could be computed and simply used twice. In essence, a single larger element
composed of elements 9 and 10 would be used as a source of light for element 2.
Why not just eliminate the two smaller elements entirely by joining them
together into a single larger element? This would be reasonable for this par-
ticular interaction. However, it may be that in another row the form factors to
elements 9 and 10 are quite different, and thus it is important to keep the effects
of elements 9 and 10 distinct for those interactions! For example, looking at
Figure 7.5, the difference between the entries of the first two columns is clearly
much more significant in the bottom row than in the top row.
Similarly, two neighboring entries in a single column may be very similar,
indicating that the element corresponding to that column makes a similar con-
tribution to the two receiving elements. In this case, a single larger receiving
element would provide sufficient accuracy. Finally, a whole block of the matrix
may be identical, indicating that the effect of a group of source elements on a
group of receiving elements could be treated as a single interaction.
This discussion has ignored visibility, which may decrease or increase the
coherence between neighboring entries in the matrix. If some polygon fully or
partially obscures the visibility between two other polygons, a series of zeros
will occur in the matrix. Rapidly changing partial visibility may also result in a
portion of the operator that was very coherent becoming less coherent.
while the two-level hierarchy reduced the number of form factors to O(n m),
the general hierarchical algorithm is O(n).
In other words, each link will represent a subset of form factors from the original
n by n matrix, that is, the form factors for all pairs of elements in the two
subtrees. A link between a pair of nodes at the lowest level connects two
individual elements and thus represents a single entry in the matrix. Links at
higher levels represent successively larger groups of form factors.
The set of entries in the original n by n matrix, K, that are represented by
a single link will map to regions in the domain of the kernel of the radiosity
integral. Remember that the kernel function is four-dimensional in the case of
a three-dimensional environment, since it is a function of two two-dimensional
points on two surfaces. Thus the local four-dimensional region represented by
a link is the cross product of the two two-dimensional regions represented by
the sets of elements at either end of the link. Since the sets of form factors
encompassed in a single link do not define complete columns of the original
matrix as in the two-level hierarchy, or neat rectangular blocks in the three-
dimensional model, it is more difficult to visualize or to explicitly construct a
matrix representation of the links. Instead, a solution method that relies directly
on the link data structure is used.
To determine the links, one could conceivably build the whole n2 form
factor matrix and then search for subsets of the matrix for which all entries
are similar in magnitude. These would correspond to potential links between
quadtree nodes and could then be grouped together into a single value. This
might, in fact, reduce the solution time for iterative matrix solution methods by
making the matrix-vector multiplications faster, but would not solve the more
important problem of reducing the form factor computation.
Instead, the aim is to develop a method of predicting whether a subset
of form factors will be coherent (e.g., similar in magnitude) before actually
computing the subset of form factors. If the subset is predicted to be coherent,
a single representative form factor can be computed for the subset. Such a
prediction method will be called an oracle in the following discussion. 4
For this discussion of hierarchical algorithms, we will use two data struc-
tures, one for a quadtree node, Quadnode, and one for a link between quadtree
node Linknode (see Figure 7.7). The hierarchical algorithm begins with
a basic recursive procedure called Refine that subdivides the surfaces into
quadtrees and create the links between quadtree nodes (see Figure 7.8). Three
functions are required:
struct Quadnode {
float Bg; /* gathering radiosity */
float Bs; /* shooting radiosity */
float E; /* emission */
float area;
float ;
struct Quadnode** children; /* pointer to list of four children */
struct Linknode* L; /* first gathering link of node */
};
struct Linknode {
struct Quadnode* q; /* gathering node */
struct Quadnode* p; /* shooting node */
float Fqp; /* form factor from q to p */
struct Linknode* next; /* next gathering link of node q */
};
SolveSystem()
{
Until Converged {
for ( all surfaces p ) GatherRad( p );
for ( all surfaces p ) PushPullRad( p, 0.0 ); }
}
GatherRad( Quadnode *p )
{
1 Quadnode *q; Link *L;
2
3 pBg = 0;
4 for ( each gathering link L of p ) /* gather energy across link */
5 pBg += p * LFpq * LqBs ;
6 for each child node r of p
7 GatherRad( r );
}
At the leaves of the quadtree, the sum of the gathered radiosity pushed
down the tree is added to the leaf nodes own gathered radiosity and
emitted radiosity and the result transferred to the leaf node's shooting
radiosity (line 3 of Figure 7.11). This quantity is returned up the tree
(line 14). Since radiosity is in units of power/area, the radiosity pulled up
the tree is the average over a node's children (line 10). For example, if
four children all have the same radiosity, their parent node will have the
same radiosity, since radiosity is measured in power/area. (By contrast,
the power for the parent is the sum of the powers of the children).
The two steps in SolveSystem are performed iteratively until less than a
user-specified maximum change occurs in the radiosity values from one iteration
to the next. Thus, it may be advisable to store a copy of Bs before zeroing it
out and then run a comparison of the copy and new shooting radiosities. This
solution process corresponds to the iterative relaxation methods described in
Chapter 5.
Figure 7.13: Geometry for simple oracle function that estimates unoccluded form
factor.
HierarchicalRad(float BF )
{
Quadnode *p, *q;
Link *L;
int Done = FALSE;
for ( all surfaces p ) pBs = pE;
for ( each pair of surfaces p, q )
Refine( p, q, BF );
while ( not Done ) {
Done = TRUE;
SolveSystem(); /* as in Figure 7.9 */
for ( all links L )
/* RefineLink returns FALSE if any subdivision occurs */
if( RefineLink( L, BF ) == FALSE )
Done = FALSE;
}
}
of the hierarchical algorithm can make better decisions about the subdivision,
thus leading to more efficient performance. The a posteriori algorithm estab-
lishes a threshold for the oracle based on the amount of energy transferred across
any individual link. The threshold BF is based on the radiosity, the element
area, and the form factor, or B F A. Since the radiosities, B, are not known
a priori, the algorithm proceeds adaptively (see Figures 7.14 and 7.15), using a
modified Oracle2 function (see Figure 7.16).
Using the modified oracle, links are formed only from quadtree nodes from
which a significant amount of energy is ready to be shot. In the first pass,
links are formed only at the highest level unless the shooting surface is a light
source. As the algorithm progresses and more surfaces receive light to reflect,
old links are broken and new links formed at lower levels as necessary. The
link structure converges when all links carry approximately the same amount of
energy.
An additional enhancement can be made by storing visibility information
with the links. When the link is created, the form factor is computed and
information describing the visibility between the two elements is recorded (i.e.,
whether p and q are fully visible, fully occluded, or partially visible to each
if ( Oracle2(L, BF ) {
no_subdivision = FALSE ;
which = Subdiv( p, q );
DeleteLink( L );
if ( which == q )
for (each child node r of q) Link( p, r );
else
for (each child node r of p) Link( r, q );
}
return(no_subdivision);
}
Polygons 98
Potential elements 175964
Potential interactions 15481576666
Table 7.1: Statistics for color plates 18-22 (after Hanrahan et al.).
other). Clearly, the fully occluded case will not benefit from further subdivision.
The fully visible case can have a more relaxed threshold set than the partially
visible case, for which one might expect larger fluctuations in the form factor
kernel across the portions of the surfaces represented by p and q.
The hierarchical basis set is redundant in the sense that any function repre-
sentable at one level of the hierarchy can also be represented one level below
(with two coefficients having values identical to the higher level coefficient).
The reverse is not the case, however. Thus, the use of hierarchical systems does
not lead to an increase in the size of the function space spanned by the bases. In
particular, the multilevel hierarchical system described in the previous sections
spans the same piecewise constant space of functions as a nonhierarchical set of
box functions consisting of only the lowest level of the hierarchy. Thus, the use
of a hierarchical system itself cannot produce an approximation B with a better
fit to the actual function B. Instead, the use of hierarchy leads to sparser linear
operators (i.e., fewer form factors) and thus more efficient algorithms.
The hierarchical set of basis functions, being redundant, would at first appear
to be less efficient since there are more bases to represent the same space of
functions. The hierarchical system, however, gains its efficiency from the fact
that, unlike the nonhierarchical formulations, not all pairs of basis functions
require interaction terms (form factors). For example, using the subscripting
shown in Figure 7.17 and a superscript to represent the surface at the root of
p
the tree, N3,4 would be the fourth basis function on the third level, for the L
level quadtree associated with surface p. In the nonhierarchical formulations K
has entries for every pair (1, j) of elements (represented as the lowest leaves in
the hierarchical system, with the basis functions at level 1). In contrast, in a
hierarchical system, if a link is established between nodes of the quadtrees on
p q
surfaces p and q, for example, between N3,4 and N5,1 , then no more links can
p q
be made from N3,4 (or any of its children on levels 1 and 2) to N5,1 (or any of
its children on levels 4 and below). Thus, this single link represents all pairings
p q
of leaves in the quadtree below N3,4 and N5,1 . In total, the single form factor on
p q
the link from N3,4 to N5,1 will represent 2 (31)
2(51) = 64 form factors at the
lowest level of the binary trees in two dimensions, and 4(31) 4(51) = 4096
form factors for the quadtrees in three dimensions!
7.6 Wavelets
A growing body of theory and applications is associated with the wavelet family
of bases [27, 185]. It is beyond the scope of this book to provide a full discussion
of wavelet theory. However, a short introduction will make it possible to cast the
hierarchical radiosity formulation in terms of a simple example from the family
of wavelets. The intention is to introduce some of the basic ideas necessary to
extending hierarchical methods to new basis sets. These new basis sets have
properties that allow them to better approximate the radiosity function and may
possibly provide even sparser representations of the integral operator. Details
can be found in [102].
Figure 7.19: Two consecutive box basis functions are equivalent to the and
functions of the Haar basis.
wavelet basis
Figure 7.20: Construction of the hierarchical Haar basis.
F(x) can also be represented by a linear combination of the Haar wavelet basis
functions:
L n/2(i 1)
F(x) = 1,L L,1 (x) +
i=1 j=1
i, j i, j (x) (7.6)
The coefficients of the box basis functions, fi , represent the local value
of F(x). In the case of the wavelet basis, the coefficient 1,L represents the
average of the function overall, and the i,j represent the local detail or variation
away from the average in F(x) at each level i. This immediately points to the
key advantage of the wavelet basis. If the function being represented is locally
smooth (in this case constant) over a portion of its domain, then the coefficients
representing the local detail will be zero (note the third coefficient in the L 2
row in Figure 7.22). While the coefficients of the original hierarchical box
functions represent local averages, the coefficients of the Haar wavelet bases
represent local differences and thus are zero in locally constant regions.
The projection of a one-dimensional function into the Haar basis can be
thought of as passing a high-pass ( or detail) and low-pass ( or smooth)
filter over the function. The filters are then applied again recursively on the
coefficients obtained in the low-pass filtering operation.
Referring again to the piecewise constant function in Figure 7.22, low and
high pass filters are implemented by taking local averages and local differences,
respectively. One application of low-pass filtering gives the coefficients 11.5,
10.5, 8.0, and 10.0. High-pass filtering gives the four coefficients, 0.5, 0.5, 0.0
and 1.0, shown in the row labeled L 2, with the coefficient 0.5, for example,
being the difference between the local average, 11.5, and the two segments of the
original function, 11.0 and 12.0. The coefficient 0.0 corresponds to a flat region
in the function (i.e., no detail). The process then recurses on the coefficients
obtained by low-pass filtering, leading to two average values 11.0 and 9.0, and
differences of 0.5 and 1.0. Finally, the last filtering pass results in the overall
average value of 10.0, which becomes the coefficient of the highest level smooth
basis, and a coefficient of 1.0 for the highest level detail basis. The Haar basis
thus results in 7 coefficients and one coefficient. The value of the function
F(x) as represented by the basis functions can then be obtained by evaluating
equation 7.6 with these coefficients.
Figure 7.22: Piecewise constant function represented with the Haar basis (top)
and the hierarchical box basis (bottom).
i
(x) x dx = 0 for i = 0, ... , M 1 (7.7)
For example, a function has one vanishing moment if its integral is zero, since
x0 is a constant. A function has two vanishing moments if when integrated
against any linear function the result is zero, and so on for quadratic, cubic, and
higher order polynomials. The Haar wavelet detail function has one vanishing
moment since any constant function when integrated against it will be zero (i.e.,
vanish). For example, in Figure 7.22 the third coefficient on the L 2 row is
zero since the local region of the function is flat.
Figure 7.23 depicts a set of four bases, two smooth and two detail, that
also span the same piecewise constant function space [102], but in this case, the
detail functions have two vanishing moments (call this the ^2 basis). In other
words, any linear function will vanish when integrated against these functions.
The price that one must typically pay for more vanishing moments is a wider
support, in this case over four intervals rather than the two of the Haar basis.
Basis sets can be constructed with varying numbers of vanishing moments and
abilities to span higher order function spaces, with associated costs in terms
of their support and the difficulty of evaluating integrals in which they appear.
Construction of such bases is not pursued here. The reader in encouraged to
investigate the expanding literature on wavelets for this purpose.
Figure 7.24. In this specific example, the piecewise constant function can be
exactly represented as a weighted sum of 16 individual box bases. Alternatively,
it can be represented by a weighted sum of only eight hierarchical Haar detail
basis functions plus the average value of the overall function represented by the
weight of the single smooth basis function. For areas in which the function is
flat (i.e., constant), the projection6 onto lower-level detail functions vanishes,
and thus these basis functions are not necessary. Similarly, projecting onto bases
with two vanishing moments will result in zero weights when the function is
linear across the support of the basis. In general, functions will not exhibit
exactly constant or linear behavior across the support of a basis. However,
regions that are almost constant (or linear) will result in very small coefficients.
In this case, the coefficients (weights) can be set to zero with only a small error
in the approximation.
The hierarchical representation of a 2D matrix using the Haar basis is some-
what similar to the hierarchical mipmap representation of a texture map [266].
6
The projection (more precisely the orthogonal projection) of one function onto
basis described in Chapter 3. The projection involves finding the coefficient or weight
of each basis function so as to minimize the norm of the difference between the original
function and the sum of the weighted basis functions.
and the last n/2 entries are detail coefficients. The filters are then applied in
the vertical direction to this matrix and the results are similarly reorganized to
give an n, by n matrix for which the coefficients in the four quadrants consist of
the detail-detail, detail-smooth, smooth-detail, and the smooth-smooth filtering
results (see letter (c) of Figure 7.25). This filtering and reorganization process
is then repeated recursively on the upper right (smooth-smooth) quadrant.
The final result of this decomposition is a hierarchy of representations of the
2D matrix (in what has been termed a nonstandard two-dimensional Haar basis
[26]). The differences between this representation and a mipmap are instructive.
The levels of a mipmap contain low frequencies (averages) in all levels of
the image. The Haar basis also begins at the top with a single average value;
however, at each level moving down from the top level the coefficients represent
the variation of the matrix values from the representation of the previous level.
The possibility for efficiency lies in taking advantage of the fact that smooth
regions of the matrix result in near zero valued coefficients that can be ignored.
The results of applying the above decomposition process to the K matrix
are shown in Figures 7.26 and 7.27 for the same flatland example (two per-
pendicular line segments) used in Figure 7.4. The top box in Figure 7.26 shows
the 32 by 32 upper right quadrant of a 64 by 64 matrix, with the dot size pro-
portional to the form factor in the original matrix. In the two boxes below,
the matrix has been projected into the nonstandard basis (examples are shown
for the Haar and ^2 basis). The three quadrants in the lower left of the boxes
are the detail-detail, detail-smooth and smooth-detail quadrants following one
complete filtering pass (see letter (c) of Figure 7.25). The smooth-smooth quad-
rant is not shown. Instead, the next three quadrants moving diagonally toward
the upper right show the result of the second complete filtering pass applied
the missing smooth-smooth quadrant. The recursive application of this process
generates the progressively lower detail representations of the matrix, as shown.
The four boxes at the bottom of Figure 7.26 show the error in the reconstruction
of the matrix (as compared to the original), after discarding (setting to zero) all
but the 32 or 64 largest terms.
Figure 7.27 shows a similar example for the case of two parallel line seg-
ments. The important thing to note is that only 32 or 64 entries, compared to the
original 32 32 = 1024 matrix coefficients have been used to reconstruct the
original matrix while incurring only very small errors. Also, note the reduced
error when applying bases with two vanishing moments (the ^2 basis).
Figure 7.26: Projecting a flatland kernel (from Gortler et al., 1993). The original
matrix shows the kernel function between two perpendicular line segments that
meet in a corner discretized into a 32 by 32 grid. Darker entries represent larger
kernel values. The kernel values are greatest in the lower left corner, where the
two segments meet and 1/r goes to infinity. This kernel is projected into both the
nonstandard two-dimensional Haar basis and the nonstandard two-dimensional
basis with two vanishing moments. In both of these representations many of
the 1024 coefficients are small. In both cases, only 32 and 64 of the largest
coefficients have been selected to reconstruct an approximate kernel. An error
matrix (the difference between actual kernel and approximate kernel) is shown.
This demonstrates that a low error can be achieved with very few entries from
the projection.
Figure 7.27: This figure shows the application of the wavelet projection to the
flatland configuration of two parallel line segments. The kernel is largest along
its diagonal, where points on the two segments lie directly across from each
other. Note the greater sparsity provided by the projection into the basis with
two vanishing moments.
In this equation K* is again a linear operator, but this time it acts on the unknown
importance Y(x). R(x) is a receiver function. The adjoint operator K* in this
case is simply KT. In neutron transport theory, a similar adjoint to the transport
equation is developed to increase the efficiency of solutions for the flux arriving
at a small receiver [68, 152].
Intuitively, one can think of importance as a scalar function over the surfaces,
just like radiosity. The value of Y(x) represents the importance of point x to
the final image, given a receiver (or eye) position. The receiver function R(x)
acts much like the light sources in the radiosity equation. It can be thought of as
resulting from a spotlight at the eye location emanating importance in the view
direction.
The receiver function can be initialized by assigning each point a value
related to the points visible projected size in the image; thus areas not seen in
the image have a zero receiver value. More formally,
cos x
if x is visible in the image cos x
R(x) = r 2 = V(eye, x)
cos eye r 2
0 otherwise
(7.10)
where the terms are shown in Figure 7.29. In the discrete function, the receiver
value Ri of each element i is proportional to the area of the image covered by
the element. If the eye point moves and multiple images are to be rendered from
the solution, the receiver function might be nonzero at any point ever visible in
the sequence
Just as light interreflects about an environment, the importance from the eye
interreflects among surfaces (see Figure 7.28). Clearly, a point that is visible in
the image will have a large importance, but a point on another surface that has
a large potential to reflect light to a visible surface will also have a significant
importance value.
If the approximate linear operator and radiosity are given by K and B , respec-
tively, and the error K in the operator is given by
K = K K (7.11)
When evaluated at a point, this norm gives a measure of the error approximation,
weighted by the importance of the point to the image and by the magnitude of
the radiosity at that point.
This leads to an algorithm (see Figure 7.30) in which one simultaneously
solves for the approximate radiosity and importance functions, making adap-
tive subdivision choices based on the importance-based metric of equation 7.13.
Clearly, minimizing the error in either the radiosity function or the importance
function alone will reduce the overall error. Importance based algorithms gain
their efficiency by taking into account both radiosity and importance, concen-
trating more effort on the radiosity function in regions of high importance, and
more effort on the importance function in brightly lit regions (i.e., high radiosity
values).
Solving for importance is very similar to solving for radiosity. If the radios-
ity associated with element i is
n
Bi = Ei + i B F
j=1
j ij (7.14)
Yi = Ri +
j=1
rj Yj Fji (7.15)
ImportanceDrivenRad( float F )
{
float eps;
for ( all surfaces p )
{
pBs = pE;
pYs = pR; /* visible area in image */
for (all mutually visible pairs of surfaces (q,q))
{ Link(p, q); Link(q, p); }
}
/* beginning with large tolerance, reduce it after each iteration */
for ( initially large diminishing to a small error threshold )
{
SolveDualSystem();
for (each link L)
RefineLink(L, ); /* see Figure 7.15 */
}
}
7.8.1 Pseudocode
The importance-based radiosity approach solves simultaneously for two un-
known functions, the radiosity function B(x) and the importance Y(x) (see
Figure 7.31). The discrete forms of the two equations after projection onto
constant basis functions are B = KE and Y = KT R. The error norm to be
minimized is then based on
YT KB (7.16)
SolveDualSystem()
{
Until Converged
{
for (all surfaces p) GatherRadShootImp(p);
for (all surfaces p) PushPullRad(p, 0.0);
for (all surfaces p) PushPullImp(p, 0.0);
}
}
GatherRadShootImp( Quadnode *p )
{
pBg = 0;
for (each gathering link L of p)
{
/* gather energy across link */
pBg += pp * LF * LqBs ;
/* shoot importance across link */
pYg += pp * LF * LqYs ;
}
for (each child q of p) GatherRadShootImp( q );
}
where K is the matrix of errors in the operator K. Pseudocode for the hierar-
chical importance-based algorithm is provided in Figures 7.31, 7.32, and 7.33.
The input to the algorithm consists, as before, of the geometry and reflectance
properties of the surfaces, the light source emissions, and additionally, the initial
importance R of each surface. This is typically the visible area of the surface in
the desired image (or images). The algorithm then recursively solves the dual
system, subdividing elements and creating new links until all interactions are
within given tolerances for the product of radiosity and importance.
The changes from the basic hierarchical code (described in section 7.4.3)
Fields to hold the receiver value R, and the importance Y must be added
to the Quadnode structure.
Importance is shot at the same time that energy is gathered over the links
(see Figure 7.32).
Pushing and Pulling importance is similar to the same operations for ra-
diosity except that the area averaging is reversed (see Figure 7.33). This
is due to the fact that radiosity is energy per unit area. Thus, moving up
the quadtree is an averaging operation. Importance, in contrast, is pro-
portional to area. Thus, moving one level up the tree requires summing
importance (line 10 in PushPullImp). Transferring radiosity and im-
portance down one level is just the reverse; radiosity is transferred directly
while importance must be parceled out according to the area of the chil-
dren (line 9) (compare PushPullImp) in Figure 7.33 to PushPullRad
in Figure 7.11).
Chapter 8
Meshing
The general strategies for automatic meshing described in the previous chapters
determine where and when to subdivide, but not how to subdivide. The actual
mechanics of subdividing geometry will be addressed in this chapter.
Basic subdivision techniques are addressed first. These are useful both for
producing an initial uniform mesh as well as for further refining a mesh by
adaptive subdivision. A priori algorithms for determining mesh boundaries that
correspond to discontinuities in the radiosity function will also be discussed.
Meshing algorithms are best constructed on an underlying topological data
structure that efficiently represents the adjacencies between nodes, edges and
elements. The basic characteristics of such data structures and how they can be
applied to meshing will be described.
Finally, several alternatives to meshing have been developed in order to
avoid some of the complexities of surface subdivision. These approaches will
be examined both for their own sake as well as for the somewhat different light
they shed on the overall problem of approximating the radiosity function.
Both basic subdivision approaches have been used for radiosity and are
described further in the following sections.
Figure 8.2: Subdivision using a template for interior elements and triangulation
to connect to boundary.
Figure 8.3: Small features of the geometry may cause poorly shaped elements.
to fill a convex quadrilateral. The mapping in this case is the same as for the
bilinear isoparametric element described in Chapter 5. Once the mapping is
obtained, a set of elements corresponding to the template can be turned into an
actual mesh simply by transforming the parametric coordinates for each node to
geometric coordinates. More general mappings can be used to handle regions
with curved boundaries or with more than four sides [235], although these have
not been applied to radiosity to date.
Although mapping increases the range of geometries that can be meshed
with template subdivision, there are limitations. The mapping may introduce
severe distortions, resulting in a nonuniform mesh of poorly shaped elements.
In addition, although a conformal mapping does exist between any two simply
connected regions with an equal number of vertices, directly mapping geometries
with more than four sides can be complicated.
8.2.3 Multiblocking
An alternative when the geometry is too complicated or is concave is to subdivide
the geometry into simpler regions or blocks first. Templates can then be mapped
directly to each of the regions.
Cohen et al. [61] use multiblocking with mapped templates in an early
radiosity implementation. Surfaces are subdivided into convex quadrilaterals
and triangles by connecting vertices of the geometry These regions are then
subdivided into quadrilateral or triangular elements by splitting the edges in half
Figure 8.4: Subdivision with mapped elements. The geometry is first split into
simple shapes. In Cohens algorithm, the boundaries are then bisected and new
vertices joined to form elements. Subdivision proceeds recursively as needed.
and joining them across the interior to create four elements. Finer mesh densities
are obtained by continuing the subdivision recursively until the desired element
size is reached (see Figure 8.4). Splitting edges at the midpoint guarantees that
new elements created on either side of the edge will be conforming.
When the initial blocks are obtained by joining the vertices of the original
geometry, the blocks may sometimes have extreme shapes that produce highly
distorted mappings. These can be avoided by adding new vertices on the bound-
ary or the interior of the geometry. As noted in [146], however, once such an
algorithm is available for the initial subdivision, there is little reason not to use
it to produce the entire mesh.
subdivided region. Triangulation of the large element in this case will produce
triangles with a poor aspect ratio. The use of slave nodes may produce a visible
artifact along the long edge, due to its close proximity to nodes at which the
function is actually evaluated.
2
Algorithms for performing this and other operations on quadtrees can be found in
Samet [204].
Mapped template methods are efficient and produce well shaped elements for
simple geometries. However, their limited flexibility is a drawback when sub-
dividing more complicated geometries and during a posteriori mesh refinement.
Subdivision methods that decompose the geometry into elements piece by
piece provide greater flexibility. There are two basic approaches to this decom-
position: the nodes and elements can be produced at the same time using a
single procedure or the nodes can be produced first and then connected to form
edges in an independent step.
Figure 8.9: Hierarchical surface subdivision using a BSP tree (after Campbell,
1990).
is commonly used since it guarantees triangles that are as well shaped as possible
(according to a certain criterion) for a given set of nodes. Delaunay triangulations
are often also constructed incrementally, positioning new nodes in relationship
to existing elements in order to achieve elements with desired shape or density.
Algorithms for connecting nodes into quadrilaterals are less common.
For radiosity applications, Heckbert [121] has incorporated a triangulation
approach into an a priori discontinuity meshing scheme. Critical element bound-
3
A Delaunay triangulation connects a given set of points so that the circle circum-
scribing any triangle contains only the points belonging to that triangle (except in the
case where four or more points are cocircular). A Delaunay triangulation also minimizes
the smallest angle of its triangles over all possible triangulations of the set of points and
thus avoids thin slivers as far as possible. A further, not inconsequential, advantage of
Delaunay triangulations is that they are a generally useful construct for computational
geometry and algorithms for producing them have thus received great attention. The
standard computational geometry text by Preparata and Shamos [184] provides a detailed
discussion. The article by Schumaker [207] provides a short overview and a discussion
of practical issues.
P
1
P = i (8.1)
n i=1
Not all nodes are equally free to move. Nodes along fixed boundaries can
move only along the boundary. Fixed boundaries include the original edges of
the geometry and mesh boundaries that may have been added a priori, such as
discontinuity boundaries. Nodes at the intersection of fixed boundaries are not
free to move at all.
Mesh smoothing is a useful tool because it relieves the subdivision algo-
rithms of some responsibility for element shape. The subdivision algorithm is
then free to concentrate on creating a correct topology. For radiosity, mesh
smoothing has been employed by Heckbert [121] as a final step following tri-
angulation.
Mesh relaxation can also be used for a posteriori mesh refinement (the r-
refinement method described in Chapter 6) by incorporating local element error
into the relocation method. For example, the following relocation formula moves
the node P according to the area weighted errors of the n elements adjacent to
the node:
i=1 xi ei Ai
n
P = (8.2)
i=1 Ai
n
Figure 8.12: A discontinuity in value. The plot to the lower right shows the ra-
diosity of the surface as a function of position along the horizontal line overlayed
on the upper right image. Courtesy of Daniel Lichinski and Filippo Tampieri,
Program of Computer Graphics, Cornell University.
node is in the light (or, at least, not shadowed by the intersecting surface). When
the light straddles the plane of the occluder, the test remains straightforward for
point sampling from factor algorithms (e.g., ray traced form factors), since it is
performed for each point sample. For other algorithms, the light in the straddling
case may have to be split temporarily across the plane.
The image in Figure 8.14 shows artifacts typically produced when value
discontinuities are ignored. Not also the extra elements generated by adaptive
subdivision in an unsuccessful attempt to resolve the discontinuity. Compare
this image with Figure 8.15, in which discontinuity boundaries are incorporated
into the mesh. The shadow leak on the wall behind the table top is eliminated
and no adaptive subdivision is required along a boundary.
Figure 8.16: First and second derivative discontinuity boundaries for a polyg-
onal environment. Note the visible discontinuity in the first derivative of the
radiosity function plotted in the lower right of the figure. Courtesy of Daniel
Lischinski and Filippo Tampieri, Program of Computer Graphics, Cornell Uni-
versity.
Figure 8.17: VE and EEE visual events, from a viewpoint looking back toward
the occluded light source.
wedge formed by the vertex and the edge that cause the event. The intersection
of this wedge with the scene polygons determines the discontinuity boundaries
resulting from this event. The critical surface and its effect on the radiosity
function are shown in Figures 8.18 and 8.19.
A discontinuity in the first derivative occurs when an edge of the source and
an edge of the occluder are coplanar, as shown in the second row of Figure 8.17.
First derivative discontinuities are evident in Figure 8.16.
Visual events can also occur where neither the vertex nor the edge belongs
to the source, as shown in row three of Figure 8.17. The visual event involving
the two occluding polygons in this case modifies the function describing the
change in source visibility, even though the event does not involve any of the
source vertices or edges.
The other class of visual events, EEE events, involves transitions caused by
Figure 8.18: A VE event caused by a source vertex and an occluder edge. Cour-
tesy of Daniel Lischinski and Filippo Tampieri, Program of Computer Graphics
Cornell University.
overlapping edges of multiple occluders (fourth row of Figure 8.17). The critical
surfaces in this case are quadric and the resulting discontinuity boundaries are
curves.
The computational challenge in discontinuity meshing is to test the scene
polygons against the critical surfaces efficiently and robustly and insert the re-
sulting boundaries into the polygon mesh.
Figure 8.20: Determining penumbra and umbra volumes using Nishita and
Nakamaes algorithm. (After Nishista and Nakamae, 1985).
Figure 8.21: The minimum and maximum extremal planes and the penumbra
volume created using the minimum blocker and source extremal planes. (After
Campbell, 1991).
of the negative halfspaces of all of the minimum blocker and source extremal
planes (see Figure 8.20). The umbra volume is constructed similarly, using the
maximum blocker extremal planes.
The resulting umbra and penumbra volumes are stored as BSP-trees. These
volumes are then merged with a BSP-tree representing the unified penumbra
and umbra volumes for the entire scene to provide an efficient means of testing
polygons against the volumes. Chin and Feiner [54] first describe the use of a
BSP-tree to represent merged shadow volumes, but for point lights only. The
merging of occlusion and umbra volumes for area lights requires more general
methods, for which Campbell uses algorithms developed by Naylor [171]. Later
work by Chin [55] describes a similar generalization of the BSP-tree shadow
volume technique to area lights.
Figure 8.24: Steps in the method of Lischinski et al. for the computation of
discontinuity edges.
topology, with each node of the tree pointing to an edge in the winged-edge
data structure. The steps of Lischinskis algorithm are shown in Figure 8.24.
Figures 8.25 and 8.26 compare results for conventional quadtree meshing and
discontinuity meshing using this algorithm. Color plates 32 and 33 show images
computed with and without Lischinskis algorithm.
Heckbert and Lischinski ignore EEE events and VE events involving mul-
tiple occluders. Handling EEE events correctly is an involved problem. Al-
gorithms applicable to finding discontinuity boundaries due to EEE events are
typedef struct {
stmct edge *vertex_edge ;
} VERTEX ;
typedef struct {
struct edge *face_edge ;
} FACE ;
endpoint, the next edge (or wing) around each of the adjacent faces is stored in
both the clockwise and counterclockwise directions. The data structures for a
face and a vertex need only keep a single pointer to any of the adjacent edges.
Operations on the topology represented by the winged-edge data structure
consist of either modifications to the topology or queries about adjacency re-
lationships. Modifications to the topology can be expressed in terms of Euler
operators [22]. (Good introductions are provided by [117, 158, 159, 267].) Euler
operators are so called because they maintain Eulers formula, which expresses
the relationship between the number of vertices, edges and faces in a topolog-
ically consistent adjacency graph. For a simple polyhedron with no holes this
formula is
VE+F=2 (8.3)
Figure 8.29 shows how a simple quadtree meshing scheme could be imple-
mented using Euler operators. A graph representing the original geometry is
first created using an initial MVF operation, followed by several calls to MEV,
and finishing with MEF to close the polygon. (One of the two resulting faces is
a pseudo-face that represents the exterior region of the graph). The polygon
is then split along the vertical and horizontal directions using SEMV to split
edges and MEF to split faces by linking vertices with new edges. Finally, one
element of the initial mesh is split further, showing how the use of a topolog-
ically complete data structure correctly handles the insertion of the new vertex
(labeled A in the diagram) along the shared edge.
Once the mesh has been created, higher level algorithms will need to query
the topological data structure for adjacency information. For example, various
ways of traversing the topology can be thought of as queries: get next face,
get next vertex around face, get next edge around vertex, and so on. The
implementations are straightforward in most cases, although edge orientation
requires special handling. When traversing the boundary of a face in a winged-
edge data structure for example, edges may be oriented arbitrarily. Therefore,
comparisons are required to determine which endpoint of the edge is the next
vertex around the face.
The basic topological data structure can be augmented with extra information
to speed up certain queries. Back-pointers might be added to allow direct access
to the parent object record from the vertex record. An extra pointer can be
added to the vertex record, allowing nodes to be linked into a list that can be
traversed directly during the solution, when it is necessary to visit all the nodes
of the scene in sequence to compute form factors or to update radiosities.
Finally, certain algorithms require the imposition of a mesh hierarchy. Hi-
erarchical data structures, like quadtrees or BSP-trees, can be maintained in
parallel with the topological data structure, with nodes of the tree pointing to
faces of the topology.
7
A helpful approach to implementing winged-edge operations is described in [98].
Figure 8.30: Approximation of the radiosity function using the rex data structure.
Each square on the shaded floor corresponds to a cell in the rex. Courtesy of
Paul Heckbert, University of California, Berkeley.
Figure 8.31: Use of the rex data structure with a higher sampling rate. Courtesy
of Paul Heckbert, University of California, Berkeley.
sampling, discontinuities need not be determined exactly, since they will never
be resolved beyond pixel resolution during rendering.
Vedel [241] uses a sampling data structure similar to the rex. Vedels algo-
rithm takes advantage of the flexibility of reconstruction from an array samples
by computing the radiosity gradient and reconstructing using an elliptical filter
oriented perpendicularly to the gradient. The heuristic is that the sample val-
ues change most quickly in the direction of the gradient, and the reconstruction
kernel should thus give less weight to values in that direction.
A related example of the decoupling shading and geometry is provided by
Wards Radiance program [254]. In Wards algorithm, radiances computed us-
ing stochastic eye-ray tracing are cached in a spatial data structure (an octree).
Whenever shading is required at a new point, the octree is checked. If values are
stored within a close enough neighborhood, the new value is interpolated instead
of being computed directly. The spatial data structure is decoupled from the sur-
face geometry and mapping difficulties are avoided, since the world coordinates
of any surface point map directly into the spatial data structure without trans-
formation. Wards algorithm is specifically view-based, but a similar approach
might be applied to a view-independent radiosity approach.
Data structures that decouple shading and geometry may prove useful for
radiosity, particularly when image information is available to bound the required
sampling resolution. Published implementations for radiosity have been limited
to simple environments and thus many practical issues related to mapping and
sampling complicated geometries remain to be explored.
Chapter 9
Rendering
Once a radiosity solution has been computed, the remaining step is to render
an image. During rendering, the model is projected onto the image plane, the
visible surfaces are determined, and a color is computed for each pixel. The
pixel color is derived from the radiance of the surface location visible at the
pixel. The radiance can be determined directly from the approximation of the
radiosity function computed during the solution. However, this approximation
is often not the best choice for rendering, due primarily to characteristics of the
human visual system. Previous chapters have addressed the computation of an
objectively accurate solution. This chapter will be concerned with the derivation
of a subjectively accurate image from such a solution.
Section 9.5 examines the question of how to map radiance values resulting
from the radiosity analysis to pixel values in such a way as to produce a sub-
jectively accurate image. Typically, allowable pixel values are integers in the
0-255 range for each of the red, green, and blue color channels of the display
device. The conversion should compensate as far as possible for the limited
range of radiance values and color resolution offered by typical monitors, as
well as for perceptual effects.
The radiosity method has thus far been presented for a monochrome (i.e.,
single color band) solution. This chapter concludes with a description of the
issues relating to color perception and the selection of appropriate red, green, and
blue pixel values to represent the more general spectra of the visible wavelengths
of electromagnetic radiation.
Repeating this process for each pixel produces a discrete map (or image) of the
approximate radiosity function.1
Unfortunately, an approximation that provides sufficient accuracy during
the solution may not be adequate for rendering. Visual perception gives certain
features more weight and others less, with the result that quantitative accuracy
does not translate directly to perceived quality. One consequence is that the
constant elements often used during the radiosity solution cannot be used during
rendering, since discontinuities in value are immediately perceived as unrealistic
1
This description ignores the issue of correctly sampling the finite solid angle of the
pixel as seen from the eye so as to avoid aliasing (jaggies) in the image. Antialiasing
the removal of these sampling artifacts, is beyond the scope of this text, For the cur-
rent discussion, it will simply be assumed that one or more samples have been used to
reconstruct a scalar radiosity value per pixel.
(see Figure 9.2). Because the eye is sensitive to first derivative discontinuities,
a C1 approximation (continuous in the first derivative) may also be desirable.
Elements providing the desired continuity could be used throughout the
radiosity solution, but if the solution is otherwise accurate enough, this unnec-
essarily increases its cost. Instead, most radiosity implementations derive a new
approximation with the desired characteristics just prior to rendering. Several
methods that take this approach are described in the following sections.
3. and (if appropriate) suitability for fast rendering using hardware Gouraud
shading.
9.2.1 C0 Interpolation
If linear elements, which provide a C0 approximation, are used in the solution
they can be applied directly for rendering. However, the radiosity solution is
often performed with constant elements. In this case, a linear interpolation or
approximation must be derived from the constant element solution to produce C0
shading in the image. A piecewise linear interpolation can be constructed
by creating linear elements with nodes at the element vertices. The values at
these vertices are then derived from the nodes of the original constant elements.
One approach to constructing a C0 interpolant is to create new nodes at
the corners of the existing elements. The radiosity at these nodes can then be
obtained by averaging the radiosities of the adjacent elements [62] (see Fig-
ure 9.3). Values at nodes on the boundary of the geometry can be extrapolated
from interior nodes, although care must be taken not to create negative values.
Finally, values in the interior of the elements are linearly (in triangular elements)
or bilinearly (in the case of quadrilateral elements) interpolated from the new
nodal values at the vertices. Nodal averaging tends to smooth the radiosity func-
tion, which can often help mask artifacts. On the other hand, smoothing may
eliminate subtle but important shading variations.
Another approach is to create a new element subdivision by connecting the
existing nodes at the centers of each original element with edges, thus using
the same set of nodes during the solution and rendering stages. For example,
to define constant elements for the solution, Sturzlinger [227] computes the
Voronoi diagram for the nodes and uses the Voronoi polygons as elements. For
linear interpolation during rendering, the corresponding Delaunay triangulation
provides elements with nodes at the vertices.
It is also possible to use a modified constant element with nodes located at
element corners instead of the center during the solution. Wallace et al. [247]
use this hybrid of constant and linear elements. During the solution, radiosities
are computed directly at the corner nodes. When needed, the constant radiosity
value for the element is taken as the average of the nodal values.2 The nodes
2
For very little extra effort, of course, these elements could be treated as true linear
elements during the solution [231].
can then be used directly for bilinear interpolation during rendering. However,
evaluating the radiosity equation at element vertices has to be handled carefully.
Problems may occur where surfaces meet and the kernel of the integral operator
becomes singular, such as along the boundary of the floor where it meets a wall.
Bilinear Interpolation
Once values have been obtained at element comers, linear or bilinear interpo-
lation can be used to determine the radiosity at each pixel during rendering.
Since interpolation is performed in the parametric coordinates of the element,
the parametric coordinates of the point to be shaded are required. Depending
on the rendering algorithm, this may require transforming the world coordinates
(x, y, z) of the point xp , to the parametric coordinates of the element.
In the case of a triangle, barycentric coordinates provide a natural parame-
terization for linear interpolation. If the three vertices of a triangle are labeled
U, V, and W, with corresponding barycentric coordinates (1, 0, 0), (0, 1, 0), and
(0, 0, 1), then the barycentric coordinate u of a point in the triangle is simply
the ratio of the area Au of the subtriangle opposite the vertex U to the area of
the whole triangle (see Figure 9.4):
A = Au + Av + Aw
u = Au /A (9.2)
v = Av /A
w = Aw /A
The radiosity B(u, v, w), is then interpolated from the corner radiosities, Bu ,
Figure 9.5: Determining parametric (u, v) coordinates from (x, y, z) world co-
ordinates.
Bv , Bu , using
B(u, v, w) = u * Bu + u * Bv + w * Bw (9.3)
v = Z
x x +x Z x Z (9.4)
u = x00 + x00 Z 00x01Z 00+ x11Z +01x10 x10 Z
where
Z = real solution to aZ 2 + bZ + c = 0
a = y 10x00 + y11x00 + y10x01 y01x10 y00x11
+ y00x10 y11x01 + y01x11
b = 2y10x00 + y01x10 2y00x10 + yx01 + yx10 (9.5)
y10x01 yx11 yx00 + y00x + y11x y01x
y10x + y00x11 y11x00
c = y10x y10x00 yx10 + y00x10 y00x + yx00
Once the (u, v) parametric coordinates of the point have been obtained, the
bilinear interpolation of the radiosities at the corners B00, B01, B11, B10 of a
quadrilateral element is
Gouraud Shading
Since bilinear interpolation is performed in the parametric coordinates of the
element, it is independent of the projection of the element onto the image plane.
For reasons of computational speed, however, some algorithms perform linear
interpolation directly in image space. Gouraud shading, the most common exam-
ple, is an incremental formulation of linear interpolation designed for hardware
scan conversion [103]. During hardware rendering, colors defined at polygon
vertices are linearly interpolated along the polygon edges in the screen projec-
tion. At each scanline, these values are then interpolated horizontally between
the two edges intersecting the scanline (see Figure 9.7).
A hardware graphics accelerator can be used to render a radiosity solution
at high speed by passing the mesh elements to the hardware as polygons, with
3
Since the perspective projection is nonlinear, distances across a polygon in the image
plane do not map linearly to distances measured on the actual polygon, Some hardware
implementations correct for the perspective transformation during interpolation.
9.2.2 C1 Interpolation
Although linear interpolation is C0 and is thus an improvement over constant
shading, it does not eliminate all perceptual problems. Linear interpolation is
still discontinuous in the first derivative at element boundaries, with the result
that Mach bands often appear along mesh boundaries (see Figure 6.2). A liner
mesh density or higher order interpolation, such as the quadratic interpolation
offered by some graphics hardware [139], can reduce or eliminate Mach bands,
since it tends to decrease the difference in slope across discontinuities. However,
piecewise quadratic or higher order interpolation does not necessarily provide
higher than C0 continuity at boundaries. Elements that provide a C1 approx-
imation will eliminate Mach bands in most cases without the need for a liner
subdivision.
The problem of interpolating or approximating the radiosity function dur-
ing rendering is analogous to the problem of constructing a surface in three-
dimensional space for modeling, where C1 or C2 surfaces are desired. The
surface modeling literature is thus a valuable source of methods relevant to
achieving approximations with particular continuity requirements. In the case of
radiosity, the surface to be interpolated is defined by the two parametric coor-
dinates of the geometry, with the third coordinate being the radiosity value (see
Figure 3.1 ).
Clough-Tocher Interpolation
Salesin et al. [203] have applied the Clough-Tocher element [56] to rendering for
radiosity. This element is constructed from three cubic triangular Bzier patches
and provides a C1 interpolant at boundaries. Salesin et al. have developed
algorithms that take advantage of the large number of degrees of freedom in this
construction to relax selectively the continuity at boundaries corresponding to
actual discontinuities in the radiosity function. When discontinuity boundaries
have been identified (at some cost), it is desirable that they not be smoothed
over by the interpolation.
The Clough-Tocher construction begins by determining radiosity values and
normals (cross products of derivatives) to the radiosity surface at the vertices
of the triangular elements used during the solution. Salesin et al. begin with
triangular quadratic elements, which have nodes at the triangle vertices and at the
midpoint of each side, but quadratic elements are not essential to the algorithm.
The construction ends with each triangle subdivided into three new cubic Bzier
triangles. The additional control points introduced in the formulation allow for
explicit control of the continuity at element boundaries.
The Clough-Tocher construction proceeds as follows:
Figure 9.10: Computing the normal to the radiosity surface at the vertices of
the Clough-Tocher element.
The normals are computed by fitting parabolas along each edge of the
triangle through the three nodal values, one for each of the two endpoints
and for the midpoint of each edge. The cross product of the tangents of
the two parabolas at each vertex provides a normal vector. Since each
corner of the triangle may also be a vertex of other adjacent elements,
this process is repeated independently for each adjacent element, and the
Figure 9.12: Three Bzier patches are constructed in the subtriangles created
by connecting the centroid to the vertices. The control points in each shaded
region are constrained to be coplanar to ensure C1 continuity across element
boundaries.
The second step is to construct three cubic Bzier triangular patches within
each element. A Bzier patch is defined by 10 control points as shown in
Figure 9.11. The value at a point B(x) within the patch is determined by
the barycentric coordinates of the point and the values of the 10 control
points using,
3! i j k
B(x) = u v w bijk (9.7)
0i, j,k3
i! j!k!
i+ j+k=3
where (u, v, w ) is the barycentric coordinate of the point, and the bijk
are the control point values. The indices ijk for each of the 10 control
points are shown in Figure 9.11. Note that the Bzier surface interpolates
the values at the triangle vertices. For example, when (ijk) = (300), then
3!
(u, v, w) = (1, 0, 0), and B(x) = 3!1!1! 1 * 1 * 1 b300 = b300.
The Clough-Tocher construction involves dividing the element into three
cubic patches by connecting the element centroid to each vertex (see Fig-
ure 9.12). The 10 control points of each subelement provide the degrees
of freedom required to ensure continuity across the element boundaries
and also make it possible to relax the continuity conditions when an edge
All four control points in each of the shaded wedges are constrained to be
coplanar. These constraints are determined as follows:
Figure 9.13: The Clough-Tocher element, showing the control net and the ra-
diosity surface produced. The shaded triangles indicate the control nodes that
must be kept coplanar to generate a C1 surface.
(a) (b)
(c) (d)
1
Figure 9.14: Comparison of linear (a), C quadratic (b), and Clough-Tocher
(c) elements to reference solution (d). Courtesy of David Salesin, Program of
Computer Graphics, Cornell University.
account the projected size of the element in the image. If the mesh resolution
is too coarse for a particular view, small features may be absent or incorrectly
represented. However, increasing the mesh density during the solution increases
the solution cost with no guarantee that the higher resolution will be adequate
for any other view.
One approach to ensuring adequate detail is to incorporate view information
into the error metric used to guide adaptive meshing. The algorithms of Heckbert
[119] and Smits et al. [220] take this approach and have been discussed in
previous chapters. Discontinuity meshing can also help guarantee that important
B(xp ) = E(xp ) + (xp ) s B(x)G(xp , x)dA (9.8)
B (xp ) = E(xp ) + (xp ) s B (x)G(xp , x)dA (9.9)
Instead of using B (x) directly during rendering, this version of the integral is
then evaluated at each pixel. In effect, the final bounce of light rays to the
eye is computed at image resolution. This includes evaluating the geometric
factor G(xp , x) at each pixel, meaning that shadows are also resolved to image
resolution.
The decision to break the solution at this point may seem somewhat arbitrary,
but it is a reasonable choice, since higher order reflections tend to contribute
progressively less to the pixel variance [135]. High spatial frequencies in the
radiance of surfaces that illuminate a diffusely reflecting surface are averaged
during integration over the hemisphere of incoming directions. Intuitively, in-
accuracies in small, high-contrast features of the radiosity function affect image
quality much less dramatically in contributing to the illumination of other sur-
faces than when they are seen directly.
Figure 9.15: Monte Carlo ray tracing, using the radiosity approximation to
determine radiance for secondary rays.
More generally, the computation of B(xp ) using equation 9.9 can be re-
stricted to locations in the image where the visible element has been identified
during the solution as liable to be inaccurate, according to any of the error
metrics discussed in Chapters 6 and 7. In the hierarchical formulation of Chap-
ter 7, one might go a step farther and only reevaluate the integral for specific
interactions that involve partial visibility and a large amount of energy.
Evaluating the integral of equation 9.8 at each pixel requires considerable
computation since it involves form factor type computations from the point xp .
Most of the form factor algorithms discussed in Chapter 4 are applicable. Several
algorithms using this approach are described in the following sections.
Figure 9.16: An image computed using Monte Carlo path tracing, with the ra-
diosity solution supplying the radiance at secondary ray intersections. Courtesy
of Holly E. Rushmeier, Program of Computer Graphics, Cornell University.
(x ) (E(x ) + B(x
1 L )) j
i i i (9.10)
n
i=1
where the ith ray from the eye intersects the environment at xi , the secondary
ray from xi to a light intersects the source at x iL and the secondary ray reflected
randomly from xi intersects the environment at x ij .
Rushmeier points out that meshing algorithms can be greatly simplified
when the radiosity solution is no longer required to capture shading features like
shadows in great detail. As with all Monte Carlo solutions, noisy images will
occur if too few sample rays are used. Figure 9.16 shows an image computed
using Rushmeiers algorithm.
Figure 9.17: Computing form factors to every element at every pixel to compute
the final bounce of the radiosity equation.
Reichert notes that although meshing requirements for the radiosity solu-
tion are less rigorous when the final bounce is evaluated at image resolution,
sampling in image space can exacerbate certain types of errors. For example,
the illumination provided by constant elements can cause shading artifacts for
nearby receivers (see Figure 9.19 (a)). Similarly, coherent errors introduced by
the form factor evaluation used at each pixel may create highly visible patterns
in the image, as shown in Figure 9.19 (b), where form factors are computed with
point sampling. Monte Carlo integration of the form factor may be preferable
in this case since it will produce noise that is less objectionable than coherent
errors.
Figure 9.18: Image computed by evaluating form factors at each pixel to every
element. Courtesy of Mark Reichert, Program of Computer Graphics, Cornell
University.
Figure 9.20: Shooting rays to compute the direct component of illumination dur-
ing rendering. The direct component is interpolated from the radiosity solution.
1. Redundant energy transport must be avoided. Each possible path for light
transfer must be accounted for only once. This may require removing part
of the radiance computed in an earlier pass before summing in a more
accurate estimate. Transport paths are discussed in more detail in the
Chapter 10.
Color plates 35-39 show the improvement of images with successive passes of
Chens algorithm.
In the discussion of the radiosity method so far it has been assumed that surface
properties such as reflectivity are constant over each surface, or at least over
the support of an individual basis function or element. This has allowed the
reflectivity term to be moved outside the integral during the computation of the
linear integral operator.
Surface detail is often simulated in image synthesis by using a texture map
to specify the variation over the surface of properties such as reflectivity, trans-
parency or the surface normal. Techniques for incorporating texture mapping
and bump mapping (mapping the surface normal) into radiosity algorithms are
described in the next sections.
B(x , ) (x p )
, (x )) = B(x (9.11)
p p p
The radiosity is simply multiplied by the texture mapped reflectivity for the pixel
over the average reflectivity [61]. This effectively undoes the multiplication of
4
This assumption can be violated when a texture mapped surface containing large
scale variations in color is located near another surface, For example, a floor with a
black and white tile pattern may produce noticeable shading variations on the wall near
the floor due to light reflected from the tiles.
the incident energy by the average reflectivity that was performed during the
solution and then multiplies the incident energy by the reflectivity (xp ) specified
for that location by the texture map. The paintings in Color Plates 10, 13, 17,
and 22 as well as the floor tiles in color plate 45 are texture maps incorporated
into the image using this technique.
It is also possible to combine texture mapping with radiosity using hardware
accelerators that support texture mapping. This is discussed in section 9.7,
where the details of rendering radiosity using hardware graphics accelerators are
described.
I = kV (9.12)
The value of varies between monitors, but is usuaully about 2.4 0.2. Thus
I 1
V = ( ) (9.13)
k
Therefore, assuming that the target radiance is in the available dynamic range
of the monitor, a voltage must be selected from the available discrete voltages,
I 1
V j = round( ) (9.14)
k
The adjustments for the nonlinear relationship between voltage and radiance
through the use of the exponent, 1/, is called gamma correction.
5
These issues are covered in much greater detail in Halls monograph [114].
6
Luminance measures light energy in terms of the sensitivity of a standard human eye,
and is computed by integrating the spectral radiance weighted by the luminous efficiency
curve for the eye over the visual spectrum (see Chapter 2). Brightness is a measure of
the subjective sensation created by light.
3. the inverse of the display device operator, (i.e., the transformation from
display luminance, Ldisp, to the required pixel value, V).
where and account for the observers adaptation to the overall image lumi-
nance, Lw. This equation provides the model for both the real-world observer
and the display observer, with different and in each case corresponding to the
adaptation levels for the different viewing conditions. The and parameters
are given by
where Lw approximates the average overall luminance of the viewed real world
scene in one case and of the synthesized image in the other.
The display operator is expressed in terms of the contrast between a dis-
played luminance Ldisp and the maximum displayable luminance Ldmax:
Ldisp
= V + 1 (9.17)
Ldmax Cmax
where V is the pixel value in the frame buffer, and Cmax is the maximum
contrast between onscreen luminances. The in V is the gamma term for
video display described earlier. The 1/Cmax term accounts for the effect of
ambient light falling on the screen on image contrast. The Cmax term is defined
by the ratio of brightest to dimmest pixels, typically a value of about 35 : 1.
Combining equations 9.15 and 9.17 and inverting them where called for, a
single operator is derived that takes a luminance, Lrw , to a pixel value, V:
1/
L rw / disp ( rw disp )/ disp
V = rw 10 1 (9.18)
L
dmax Cmax
This relation maps the results of the global illumination simulation into a best
choice of pixel values, thus providing the last step in the image synthesis process.
Figure 9.22. Images produced after accounting for brightnesses and viewer
adaptation based on work by Tumblin and Rushmeier. Light source intensities
range from 105 lamberts to 103 lamberts in geometrically increasing steps by
100. Coutesy of Jack Tumblin, Georgia Institute of Technology.
9.6 Color
The topic of color has been ignored in the previous chapters partly because it
is a complex topic in its own right, and partially because it is not integral to
the explanation of the radiosity method. Each of the issues addressed in the
earlier chapters is valid (with a few provisos7), for a full color world as well as
a monochrome one. The geometric quantities such as the form factor are inde-
pendent of material properties like color. The solution process is independent of
color in as much as a separate solution can be performed for each wavelength
or color band of interest.
A full description of color and color perception cannot be provided here.
Instead, interested readers are referred to a number of excellent sources for more
detail [156]. Valuable information from researchers in image synthesis can be
found in [114, 166].
Questions of immediate interest addressed in this section are,
What and how many wavelengths or color bands should be used in the
radiosity solution?
Can a single scalar value be used for error criteria, and if so, how is a
reasonable achromatic value derived from the color model?
How can one transform values between color models to finally derive
RGB pixel values?
models are used at three stages in the radiosity simulation: (l) as part of the
description of the environment to be rendered, (2) during the radiosity solution,
and (3) during the creation of the final image on the output device. The same
or different color models may be used at each of these stages. Different color
models and means to transform values between them are discussed below.
The selection of a color model for the radiosity solution depends on the
required accuracy of the color reproduction and available information about
the lights and surfaces contained in the input to the simulation. For example, if
colors are input in terms of red, green, and blue components, then the simulation
can proceed by computing red, green, and blue radiosity values at each node. The
results can then be mapped directly to the RGB phosphors on a CRT based on
the specific properties of the monitor. However, this simple RGB color model
contains inherent limitations that make it difficult or impossible to reproduce
exactly the subtleties of color in the real-world. A fuller description of the
visible energy (light) at each point requires a specification of the energy at all
wavelengths in the visible spectrum. If a full (or sampled) spectrum of the
emitted energy of light sources and of the reflectivity of materials is available,
methodologies can be developed that lead to more accurate color simulations.
The eye is not equally sensitive to light of different wavelengths even within the
visible portion of the electromagnetic spectrum. The luminous efficiency function
(see Figure 9.23) describes the eyes sensitivity to light of various wavelengths
and can be used to convert between radiance, which is independent of perceptual
phenomena, and the perceptual quantity, luminance.8
Thus, when working in an achromatic context (black and white), it is best
to multiply the energy spectrum by the luminous efficiency function to obtain a
scalar luminance value that can be displayed as a gray value or used as a deci-
sion variable for element subdivision. As will be discussed below, certain color
models contain one channel devoted to carrying achromatic luminance infor-
mation and are thus a convenient model for image synthesis. Scalar luminance
values can also be derived from sampled wavelength-based models by weighting
the energy at each sample wavelength by the corresponding value in luminous
efficiency function.
Color Sensitivity
Color perception results from receptors in the eye called cones. It has been
found that normal human eyes have only three types of cones, each with distinct
responses to light across the visible spectrum (see Figure 9.24). One type of cone
is sensitive primarily to short (S) wavelengths, one to medium (M) wavelengths,
and the other to longer (L) wavelengths. Color blindness is believed to be caused
8
The corresponding units of measure from the fields of radiometry and photometry
are discussed in Chapter 2.
Figure 9.24: Response of three color cones in eye (after Meyer, 1986).
Figure 9.25: Color matching experiment and resulting color matching functions.
side and add it to the test source. This quantity is then counted as a negative
amount of that primary.
The three resulting matching functions now provide all the information re-
quired to match not only the monochromatic test sources, but any combination
of energy across the spectrum. A general spectrum E(l) can be represented
with a linear combination of the primaries (s, m, l) given by
E() = S * s + M * m + L * l (9.19)
where
S = E() s()d
M = E() m()d (9.20)
L = E() l()d
In fact, the three matching functions can be replaced by any three independent
linear combinations of the original three matching functions, resulting in a new
color space defined by new matching functions. These can be used in exactly
the same way as the results of the original matching experiment.
A commonly used set of matching functions was developed in 1931 by
the Commission Internationale de lclairage (CIE) based on the standard ob-
servers matching functions. The CIE functions, x(), y(), and z(), are
shown in Figure 9.26. These were chosen such that the XYZ color space con-
tains all possible spectra in the positive octant and y() corresponds to the
luminous efficiency function.
Figure 9.27 shows the CIE XYZ color space. A direction emanating from
the origin in this space represents all multiples of a particular linear combination
of the three matching functions. Within the limits discussed in section 9.5, the
points along a line from the origin will all produce the same color sensation at
different brightnesses. The horseshoe-shaped curve indicates the directions in
the space corresponding to the set of monochromatic sources (i.e., the rainbow)
Figure 9.27: The CIE XYZ color space with cone of realizable color.
from approximately 400 to 700 nanometers. Any point (X, Y, Z) lying within
this cone of realizable color represents some linear combination of visible light.9
The triangle (X + Y + Z = 1) is also shown. A chromaticity diagram
can be constructed by projecting the set of points on this triangle onto the XY
plane. A point on this projection (x, y) represents a vector (X, Y, Z) where
X
x = X+Y+Z
Y
(9.21)
y = X+Y+Z
Figure 9.28 shows this projection including the location of the red, green, and
blue phosphors of a typical CRT. All possible colors on a CRT (the monitors
gamut) include only linear combinations of the RGB phosphors, which explains
why not all colors can be reproduced. In particular, it is impossible to display
saturated yellow-green colors on a CRT.
The CRT is also constrained by the dynamic range of the phosphors, as
was described earlier. Figure 9.29 shows the CRTS RGB color space and its
transformation into the XYZ color space. All possible colors on a CRT thus lie
within the skewed cube shown.
9
A point outside the cone of realizable color simply does not exist, as it would require
a negative amount of light at some set of wavelengths.
The transformation between XYZ and RGB spaces depends on the specific
phosphors of the monitor in question. Details of how to measure the phosphors
can be found in [114]. The NTSC transformation for a generic or standard
monitor is given by
X 0.67 0.21 0.14 R
Y = 0.33 0.71 0.08 = G (9.22)
Z 0.00 0.08 0.78 B
The approximate inverse is
R 1.730 0.482 0.261 X
G = 0.814 1.652 0.023 = Y (9.23)
B 0.083 0.169 1.284 Z
Hall [114] provides an appendix with code for this and other transformations
between color spaces.
Figure 9.29: RGB cube and monitor gamut within the CIE XYZ color space.
Other color spaces exist for a variety of reasons. The YIQ space is designed
primarily for television with the Y channel carrying luminance. A color space
based on cyan, magenta, and yellow (CMY) is used for printing since inks
subtract light. Thus, in this context, CMY is complementary to the RGB space.
Hue, saturation, and value (HSV) and hue, lightness, and saturation (HLS)
spaces are also used for their direct mapping to human subjective descriptions of
color. Other color systems have been developed to attempt to create linear color
spaces in a perceptual sense through nonlinear transformations of the earlier-
mentioned primaries. These additional color spaces will not be discussed here
as they are not generally used for image synthesis directly. However, many
computer-aided design systems use them. For each color space, a transformation
to the XYZ space can be found.
Any of the three color spaces can be used for radiosity computations. The
solution step, for example the Gauss-Seidel or Southwell iterations discussed in
Chapter 5 or the PushPull steps in the hierarchical solutions of Chapter 7,
must be repeated for each dimension (or channel) of the selected color space.10
Independent of the choice of color space, the values should be stored in a
floating point format or a large enough integer format to handle many orders of
magnitude. The reason for this lies in the nonlinear response of the eye to light.
Thus, the transformation to one-byte (0-255) phosphor values should only take
place at the final display stage.
Conceptually, using an RGB color space throughout the image synthesis
process is simplest and requires no intermediate processing after converting light
source and reflection spectra into RGB. In fact, many CAD modeling systems
only allow specification of color in terms of RGB. However, this immediately
restricts the possible colors for both lights and reflective surfaces to the monitors
gamut. In addition, accounting for differences from monitor to monitor is very
difficult to incorporate into such a system.
The limitations of the RGB space would argue for a display independent
color space such as the CIE XYZ space. An additional argument for such a
system as the CIE XYZ is that the Y channel can be used directly as a measure
of luminance and thus provides a simple criteria for error metrics in decisions
such as element subdivision. In fact, one might choose to perform all radiosity
computations only on the Y channel until element subdivision has completed.
The X and Z channels can then be processed based on the final element mesh.
However, any three-dimensional coordinate space requires an a priori integration
of the reflection and light source emission spectra. This can cause inaccuracies
as light from one wavelength will influence another through this prefiltering
operation.
10
It is worth repeating that the form factor computation, are independent of color and
thus only need to be computed once.
E456.4
X 0.1986 0.0569 0.4934 0.4228 E
Y = 0.0034 0.1856 0.6770 0.1998 = E490.9 (9.24)
Z 0.9632 0.0931 0.0806 0.0791 557.7
E631.4
Light sources characterized by spectra with one or more narrow bands will cause
problems in systems that rely on discrete wavelength sampling; however, most
reflectors exhibit smooth reflection spectra. The details of the derivations and
experimentation in Meyers studies are not repeated here. A set of C code
implementations can be found in the appendices of Halls book [114].
9.7.1 Walkthroughs
If views of the radiosity solution can be rendered quickly enough, an interactive
walkthrough of the shaded environment is possible. Airey [5] reports that the
sensation of interaction requires at least six frames per second. Thus, radiosity
solutions are often rendered using hardware graphics accelerators, in spite of the
limitations of Gouraud shading discussed earlier. This section provides a short
discussion of some of the practical issues with the use of hardware graphics
accelerators for radiosity rendering.
The basic approach is to define a view camera, then pass each element in
the mesh to the graphics accelerator as a polygon with a color at each vertex
corresponding to the (scaled) nodal radiosity. Light sources are turned off during
the rendering, since the radiosity simulation has precomputed the shading. If the
use of mesh primitives (e.g., triangular strip, quadrilateral mesh or polyhedron)
is supported by the hardware, they can be used instead of individual polygons
to speed up rendering further. The basic flow of data to the graphics pipeline is
shown in Figure 9.31.
It is straightforward to add specular highlights during hardware rendering.
In this case, one or more light sources are turned on, approximating the po-
sitions of the light sources used during the solution. Specular colors and the
Phong coefficient are defined as appropriate as the elements are passed down the
pipeline. Where the original geometry was defined with vertex normals, these
should be interpolated to the nodes and passed along with the other vertex data
for each element. The diffuse color of all polygons should be set to zero since
the radiosities at each vertex provide the diffuse component. Depending on the
hardware shading equation, it may be necessary to turn on the ambient light
source so that the vertex colors are included in the shading equation.
tion, it can be possible to apply texture mapping to polygons that have been
shaded using radiosity. The goal is to have the shadows and other shading vari-
ations computed by radiosity appear on the texture mapped surface. For this to
work, the hardware shading equation must multiply the texture color at a pixel
by the color interpolated from the polygon vertices. The polygon vertex colors
can then be used to represent the incident energy at the element nodes, with the
texture color representing the reflectivity of the surface. As described in Chap-
ter 2, the incident energy at a node can be obtained by dividing the radiosity
at the node by the surface reflectivity used during solution (usually the average
color of the texture map). The product of the incident energy and the reflectivity
determined from the texture map then gives the reflected energy or radiosity at
the pixel.
If u, v texture coordinates are defined at the original polygon vertices, they
will have to be interpolated to the element nodes during meshing. During ren-
dering the vertex u, v coordinates and vertex colors corresponding to the incident
energy are then passed down to the hardware for each element.
inside this volume are potentially visible to the observer. The details of this
algorithm are beyond the scope of this book. However, the reader is encouraged
to investigate this work as it introduces a number of concepts and techniques of
potential value to future research.
In addition to the development of candidate sets for visibility, interactive
rates can sometimes be maintained by displaying a lower detail environment. If
the mesh is stored hierarchically, a low-resolution version of the mesh can be
displayed while the view is changing rapidly, and then replaced with a high-
resolution version when the user rests at a certain view [5].
Chapter 10
Extensions
Radiosity demonstrates the potential power of finite element methods for global
illumination calculations, at least in the case of environments consisting of Lam-
bertian diffuse reflectors. Given this success, it is natural to ask whether this
approach might be generalized to handle a wider variety of global illumination
phenomena.
In Chapter 2, the radiosity equation is derived from a general model of
light energy transport by restricting the problem in various ways. For example,
diffraction, polarization, and fluorescence are ignored, on the assumption that
these make only small, specialized contributions to everyday visual experience.
Light is assumed to move with infinite speed, so that the system is in a steady
state. Scattering and absorption by the transport medium (e.g., the air) are
disregarded. Most importantly, the directional dependency of the bidirectional
reflectance distribution function (BRDF) is eliminated by limiting the model to
Lambertian diffuse reflection.
Although computationally convenient, some of these assumptions are too
restrictive for general-purpose image synthesis. This chapter presents approaches
to lifting the restrictions to Lambertian diffuse reflection and nonparticipating
media. Specialized light emitters, such as point lights, spot lights, and sky or
natural light, are also discussed in the context of a radiosity solution.
Isotropic Point light: light emanates from a point with equal radiant in-
tensity in all directions. The flux density falls off according to 1/r2.
Spot light: light emanates from a point with a variable intensity that falls
off from a maximum as the direction deviates from a given axis.
Sky light: light emanates from a hemisphere representing the sky, possi-
bly accounting for weather conditions and solar position (but not the sun
itself).
General light emitters are discussed in the context of a ray tracing algorithm in
[243]. General luminaires and/or sky light have been incorporated into radiosity
applications in [74, 144, 176].
Although conceptually simple, the inclusion of more general light emitters
into a radiosity solution requires some care, particularly with regard to units
and normalization. In previous chapters, emission has been specified in units of
energy/unit area/unit time (or power/area). Since point and parallel sources have
no area, they will require different units. Normalization relates to the problem
of defining the total power of a spot (or more general) light independently of
the width of the spot beam or the shape of the intensity distribution.
The following discussion will assume constant basis functions, but the basic
concepts apply equally to higher order basis functions.
Point or parallel sources obscure the intuitive definition of the form factor
somewhat, since they have no area. For the same reason, units of power/area
have no meaning for point light sources and the total power or power per solid
angle (power/steradian) must be used instead. Using the reciprocity relationship
In general, the new light sources will be defined in terms of power, which is
equivalent to the factor EiAi, as opposed to the emitted radiosity Ei (power/area).
Including such a light source into the matrix formulation requires modifying the
row and column corresponding to the source. First, for a light i the ith column
of K must be divided by Ai to account for the fact that the lights contribution
as represented by those terms will be in units of power rather than radiosity. The
corresponding entry Bi in the vector of radiosities is now interpreted in units of
power, since it is the power of the light source (i.e., it is multiplied by Ai to
account for the division in the ith column). The entries Kji of the matrix were
originally given by
A
Kji = j Fji = j Fij i (10.3)
Aj
power
perp. area
1 cos j V (x , x )dA
Fij =
Ai 4 r2 j i j (10.5)
The 1/4 term converts the total power to power per steradian, and the remainder
of the integrand is the visible solid angle subtended by element j.
r
Fij = Ai cos j V( , x j )dA j (10.6)
r
where V( , xj ) is the visibility of the infinite source from a point xj on element
r
j in the inverse direction of the light. The function V( , xj ) equals one if a
r
ray from dAj in direction does not hit anything, and zero otherwise.
The form factor from a point light i to an element j can now be derived.
Again, the form factor is proportional to the solid angle subtended by j from
r
the point of view of the light and is scaled at each dAj by S( ):
r cos j
Fij =
Ai
S( ) 2 V (x i , x j )dA j
r
(10.8)
r
where is a vector from the light sources to dAj.
For general area lights, the goniometric diagram must be converted to lumi-
nance by dividing by the projected area of the source. For example if the light
intensity, I, is, given in terms of candelas (cd), then the luminance (cd/m2) is
given by
Le ( ) = 1 I (10.9)
cos Ai
In this case, the form factor must be integrated over the area Ai of the light and
normalized by dividing by Ai,
r cos j
Fij = I S( ) 2 V (x i , x j )dA j (10.10)
Ai Ai Aj r
this case the solid angle is not from the source but rather the solid angle to the
source (see Figure 10.2). This does not present a problem, due to the reciprocity
relationship.
The CIE1 provides a number of formulae for estimating the luminance of
a point P on the sky hemisphere, depending on cloud cover and sun position.
For a completely overcast sky the luminance is given by
(10.13)
L( ) = Lz 1 + 2 cos (10.12)
3
where Lz is the luminance at the zenith. In this simple empirical model, the sky
luminance is assumed uniform in a circle at any given height, so the luminance
is a function only of the angle between the zenith and the point P. The sky
in this model is brightest at the zenith and darkest near the horizon. The value
of Lz is itself a function of the height of the sun. It should be noted that this
model is generally not accurate for low-lying cloud cover.
For a clear sky, the CIE gives the following function:
3 0.32 sec
+ 0. 45 cos )(1 e
2
(0. 91 + 10 e )
L( , ) = Lz 3z0 2
(10.13)
0. 274(0. 91 + 10 e + 0. 45 cos z 0
where Lz and are as above, z0 is the angle between the zenith and the sun,
and the angle between the sun and P (see Figure l0.2). The angle can be
computed from the angle formed by the projections of the sun and P onto the
ground plane (see Figure 10.2), using cos = cosz0 cos + sin z0 sin sin
[1].
If the zenithal luminance Lz is converted to radiance Rz (see Chapter 2),
then the form factor term can again be derived. This requires an integration over
r
the sky dome hemisphere, , as well as over element j. S( ) is again defined
r
as the ratio of the radiance in direction to Rz (zenithal radiance).2 The form
factor to the sky is then given by:
r
S( ) cos j r
Fij =
Ai
2
V ( , dA j ) dA j d (10.14)
Takagi et al. [229] provide a valuable discussion of sky light in the context
of the photo-realistic rendering of automobiles in exterior scenes. Nishita and
Nakamae [176] discuss sky light specifically in the context of radiosity. In
particular, they address the issue of determining occlusion with respect to sky
light, as well as techniques for interiors that receive sky light through windows.
1
Commission
r Internationale de lclairage
2
S( ) may return a value greater than one near the sun in the clear sky model.
10.1.7 Normalization
The use of the standard Lambertian diffuse area sources requires the specification
of the source in terms of radiosity, or power/area. Thus, if the area of the light
source is changed and the radiosity is held fixed, the total power will change in
proportion to the area. Similarly, the above derivations of the form factors for
general luminaires and spot lights required the source to be defined in terms of
power/sr. As a result, if the maximum power/steradian of a spot light is held
fixed and the exponent n is allowed to vary, the total power of the light will fall
as n grows.
It is often desirable to specify an area source in terms of total power, thus
allowing the size of the diffuse source to vary without affecting emission. It
is also useful to have spot lights or more general luminaires specified in terms
of total emitted power, with the spotlight function or the goniometric diagram
defining only the relative intensity distribution.
r
This requires a normalization to replace the scaling function S( ) (just 1
for Lambertian sources) with a probability density function that by definition
integrates to 1 over the sphere for directional sources and over the area for area
sources. The advantage in this system is that as the area of a diffuse source or
the distribution of the spot light or general luminaire changes, the total amount
of energy emitted by the source remains constant. This provides a much more
intuitive system for modeling lights and determining their relative contributions
to the illumination of the environment. An additional advantage is that Monte
Carlo sampling, as described in Chapter 4, becomes straightforward.
Providing this normalization in source specification requires the derivation
of a normalization scaling factor based on the size and/or distribution of the
source.
Lambertian Diffuse Area Source: This is straightforward in the case of
the diffuse source. The source i can be specified in terms of total power, and
the scaling factor is simply 1/Ai.
Spot Light: In the case of the spot light, the normalization factor is deter-
mined by integrating the distribution function over the hemisphere:
2 /2
0 0
cos n sin d d (10.15)
The spectral distribution and luminance for natural (sky) light depends on
time of day, latitude and sky conditions (e.g., clear or over cast). The different
spectral values for direct (direct line to the sun) and indirect (from the hemisphere
of the sky) can be found in the [2] or [177]. A rough approximation of a (clear
sky is a blackbody at 15000K, and for an overcast sky, a blackbody at 6500K
The luminance of indirect natural light is generally in the range of 1000 to 5000
cd/m2. Direct sunlight is well represented spectrally by a blackbody at 5800K
with a magnitude of approximately 1300 W/m2.
3
Note that wattages given for light bulbs represent consumed power, not emitted light
energy. Most of the consumed power is converted to heat. A typical tungsten filament
converts only a small fraction (about 5 percent) of the consumed power to visible light.
u = e + Ku (10.18)
In the case of the rendering equation, u corresponds to the radiance function and
e to the emission term. A solution to integral equations of this type (an exact
4
In practice, algorithms more typically take each path as representing a packet of
photons (a ray or beam). Each packet starts from the light carrying a certain power,
which is reduced at each interaction to account for absorption [214].
solution in the case of the rendering equation) is given by the Neumann series
Each term in this equation represents a subset of the infinitely many paths that
start at the light source and enter the eye from a particular direction. The first
term, e, is the path leading directly from the light to the eye. The second term,
De, consists of paths that start at the source and are diffusely reflected once
before entering the eye, while the third term, Se, represents paths that contain
one specular reflection, and so on. In all, light reaching the eye from a given
direction may have traveled from the source via paths that include any number
and combination of diffuse and specular interactions (see Figure 10.3). Since the
series is infinite all possible light paths are accounted for. Similarly, an algorithm
that accounts (correctly) for all paths provides a solution to the integral.
Heckbert suggests the use of regular expressions5 to simplify the description
of paths. With the addition of L to indicate emission from the light and E to
5
A regular expression describes a language consisting of words constructed from a
Figure 10.3: Some of the paths contributing to the radiance for a particular
direction leading to the eye.
5
A regular expression describes a language consisting of words constructed from a
given alphabet. The expression formally expresses the set of words that can be realized
in the language and consists of a string of characters constructed from the alphabet plus
the superscripts * and +, the symbol 1, parentheses (), and the empty string . The
superscript * indicates any number (including 0) of repetitions of the superscripted term.
For example, D* indicates the set { , D, DD, DDD, DDDD, ....}. The superscript +
is similar to * but does not include the empty string (i.e., there must be at least one of
the superscripted term). The symbol | means OR, and the parentheses have the obvious
meaning.
cal diffuse shading) and LSE (the Phong highlight), as shown in Figure 10.4.
In addition to ignoring paths involving multiple reflection, such models often
ignore shadowing, and thus include nonphysical paths. Classical ray tracing
handles the paths LDS*E | LS*E, but with some restrictions (see Figure 10.3).
The sequence LS in any path approximates glossy reflection using the Phong
model, but subsequent specular reflections ignore all but ideal specular reflec-
tion. Distribution ray tracing extends ray tracing to account for all paths in
LDS*E | LS*E. Radiosity is limited to the paths LD*E since in its traditional
form it cannot handle specular reflection (see Figure 10.6).
Eye-Ray Tracing
For portions of paths consisting of the sequence S*E, the BRDF provides an a
priori basis for estimating the importance of various paths. The eye position and
the pixel location determine the outgoing direction for the final S interaction,
and the shape of the BRDF provides a guide as to which incoming directions are
likely to contribute significantly.6 (In the case of ideal specular reflection, the
outgoing direction determines the only contributing incoming direction.) Work-
ing backwards from the eye, each subsequent S interaction along the path can be
treated similarly. This provides the basic strategy for Whitted-style ray tracing
and distribution ray tracing.
The utility of this strategy hinges on the ability to distinguish a limited
number of incoming directions as important. As the brdf becomes increas-
ingly diffuse, the relative importance of different incoming directions becomes
correspondingly closer to equal and an increasing number of incoming direc-
tions must be considered for an accurate estimate (see Figure 10.7). At some
point this strategy becomes prohibitively expensive. In such cases, most ray
tracing algorithms give up and determine importance based on the location of
the luminaires rather than the BRDF.
Light-Ray Tracing
6
A posteriori sampling is also useful, since the actual contribution coming from various
incoming directions cannot be estimated until some samples have been taken. The graph-
ics literature contains a great deal of discussion of such strategies [71, 135, 140, 147].
LS*. In this case, a path starting at the light intersects a surface, which deter-
mines an incoming direction, and the BRDF provides a basis for weighting the
importance of all possible outgoing directions. This is the motivation for light-
ray tracing, which is often used to find what are loosely referred to as caustics7.
Light-ray tracing for this purpose was first described by Arvo [12], although it
was applied to shading by Appel very early in computer graphics [8]. Many
subsequent algorithms have also used this approach [120, 214, 272]. As with
eye-ray tracing, this strategy loses its utility once a D interaction is encountered
(see Figure 10.7).
If there is only one D interaction, light-ray tracing and eye-ray tracing can be
combined to account for all paths by having them meet in the middle at the
diffuse surface (an approach often called bidirectional ray tracing). Light rays
that end on the diffuse surface typically have their power deposited in bins
into which the surface is subdivided. Eye rays ending on the diffuse surface
then interpolate the stored power to approximate contributions that would be
obtained by tracing the path farther (see Figure 10.8).
7
Although the term caustic has a very specific meaning in optics, in image synthesis
it has often been used more generally to refer to the illumination of diffuse surfaces by
light reflected from a specular surface. Mitchell and Hanrahan discuss caustics in detail
in [168].
Figure 10.7: Light-ray tracing and eye-ray tracing. Neither provide an advan-
tage for path segments containing a diffuse interaction.
Bidirectional ray tracing handles the paths LS*DS*E. Paths are effectively
broken at the diffuse surface by averaging together the effect of many paths
landing within a certain bin. This takes advantage of the fact that the ideal
diffuse component of radiance usually changes fairly slowly, a consequence of
the fact that incident illumination is integrated over the entire hemisphere of
incoming directionsessentially a filtering operation.
The next sections will present methods for accounting for these missing
paths in the radiosity solution. Such methods can be classified as either implicit
or explicit. In an explicit method, the global illumination problem is formulated
in terms of the radiance L(x, ). An approximation of L(x, ) is computed and
stored for all surfaces, including those with a BRDF containing glossy or ideal
specular components.
The discretized radiosity equation expresses the radiosity for each element as a
linear sum of the radiosities of all other elements. Somewhat surprisingly, it is
possible to rewrite the equation, leaving out certain elements and still form a
correct solution for the remaining elements. The new system will be correct as
long as the coefficients of the radiosity equation, the form factors, account for
all paths between the elements of interest. This can be used to incorporate the
effect of glossy and ideal specular surfaces into the radiosity solution.
As an example, if there are four elements {a, b, c, d} (see Figure 10.10)
element b can be eliminated from the computation by computing extended form
factors from all other elements to all other elements via element b. In the case of
constant basis functions, the extended form factor Fdba represents the fraction of
energy leaving element d and arriving at element a after reflecting from element
b. If all surfaces are diffuse, then Fdba = Fdb * b * Fba. An equivalent system
of form factors can thus be constructed given all extended form factors with b
as the intermediate element, by
1. adding Fibj to the term Fij, for all pairs ij, and
The resulting system is equivalent to the original system, insofar as the included
tended form factors for paths that contain a single ideal specular bounce (DSD)
from a planar surface (i.e., a mirror). With these limitations it is possible to
compute extended form factors using the hemicube algorithm. Mirrors are sim-
ply treated as openings into a virtual mirror world, which consists of the entire
scene flipped about the plane of the mirror. The form factor to an element in the
mirror world is added to the form factor to the element in the normal world, to
obtain the total extended form factor. Rushmeiers mirror form factor algorithm
provides the first pass of the two-pass method described by Wallace et al. [246].
Hall [114] provides pseudocode for the mirror form factor algorithm.
Malley, Sillion, and others [142, 157, 218] compute extended form factors
using recursive ray tracing. This allows multi-bounce DS*D paths to be fol-
lowed and BRDFs with a glossy reflection component to be included. It also
extends the method to nonplanar surfaces. In addition, ray tracing can be used to
compute extended form factors that account for transparent, refracting surfaces.
Shirley [212] has demonstrated the use of extended form factors to eliminate
a Lambertian diffuse surface from the solution. In this algorithm, the radiosity
of the excluded surface is computed during rendering using Monte Carlo ray
tracing.
Color plates 43 and 44 provide a comparison of images computed with and
without the use of extended form factors. Note the light missing from the top
of the table in front of the mirror in the before image.
Figure 10.12: Rendering using the results of the global cube algorithm.
r
the opposite direction . Note that the reflectivity terms now also depend on
direction.
The resulting (n m)2 matrix can be formulated and solved as in the
conventional radiosity method. The matrix is very large but extremely sparse,
since a given node can interact with another node via only a single pair of
incoming and outgoing directions. Immel et al. anticipate progressive radiosity
by solving for the element radiosities in roughly the order of light propagation.
During rendering, Immel et al. obtain the radiance at a node for the view
direction by linearly interpolating between the sampled outgoing directions that
bound the view direction (see Figure 10.12). Radiances on the element interiors
are obtained by linear interpolation from the resulting nodal values. Hall [114]
provides pseudocode for the global cube algorithm, with discussion of some
related practical issues.
While the global cube algorithm approximates all paths in L(D|S)*E, the
algorithm runs into trouble for highly directional BRDFs, as shown in Fig-
ure 10.13. The fine details of the reflection in the floor of this image are poorly
approximated and display obvious artifacts. An accurate approximation of a
highly directional radiance distribution requires an extremely fine mesh, as well
as a high resolution global cube, which results in impractically high storage
requirements and solution times. Furthermore, increasing the cube resolution
everywhere is inefficient, since high resolution is principally required for por-
tions of paths ending at the eye.
Figure 10.13: An image produced using the global cube algorithm. Courtesy of
David Immel, Program of Computer Graphics, Cornell University.
Iterative Refinement
Shao et al. [210] address ideal specular and glossy reflection using the conven-
tional radiosity equation by changing the meaning of the form factor. As in
conventional radiosity, the form factor from a directionally reflecting surface Aj
to a second surface Ai is the fraction of the total energy leaving Aj that reached
Ai . For directional reflection, however, the amount of energy reaching Ai from
Aj will depend on the actual distribution of outgoing radiance for Aj . For a
glossy surface, this is a nonuniform distribution that depends on the BRDF and
the distribution of incoming energy. Thus, unlike a true form factor, Shaos
form factor is not purely geometric and cannot be computed a priori.
Shaos modified form factor is computed using the hemicube to determine
which elements are visible in all directions. The delta form factor for a receiv-
ing element seen through hemicube pixel p depends on the radiosity of other
elements contributing incoming energy through other hemicube pixels. The con-
tribution of the incoming energy for hemicube pixel q to the delta form factor
for pixel p is weighted using the BRDF for the element. Thus, the form factor to
a given receiving element will depend on the radiosity of elements contributing
incoming energy from other directions.
Clearly, Shaos form factor cannot be computed a priori, since it depends on
already knowing the element radiosities. Instead, he uses an iterative approach
to refine the estimate of the factors gradually. The initial step is to compute a
conventional radiosity solution, ignoring directional reflection. Form factories can
then be computed with respect to all directionally reflecting elements, using, the
initial radiosity solution to provide an estimate of the incoming distribution of
light for those elements. The radiosity matrix is reformulated and resolved with
the new form factors. The improved estimate can be used again to refine the
form factors further. To save time, the hemicubes are computed only once, and
then stored to be reused during later iterations.
The converged solution accounts for light arriving at diffuse surfaces via
directional reflection from other surfaces. Shaos approach is an explicit method,
in that approximations of the directional radiance distribution are computed when
needed during the solution. However, these approximations are not suitable for
rendering, for the same reasons noted for Immels algorithm, and distributed
ray tracing is instead used to determine the directional component at image
resolution.
Hall and Rushmeier [113] describe improvements to Shaos basic approach,
including adaptive subdivision for directionally reflecting surfaces and extensions
to progressive radiosity.
In the global cube algorithm, the use of constant basis functions of a fixed width
to represent the directional radiance distribution means that a very large number
of directions must be evaluated and stored for each node to ensure that small
features are captured. Sillion et al. [217] observe that, just as with functions
defined over a surface, higher-order basis functions defined over the sphere of
directions should allow the distribution to be approximated with fewer samples.
Since the BRDF and the directional radiance distribution are functions defined
over the hemisphere, Sillion proposes the use of spherical harmonics as a basis.
The first three terms in the series are plotted in Figure 10.14.
Spherical harmonics are an infinite series, analogous to the Fourier series,
that can represent a large class of functions defined over a sphere. The first three
sets of spherical harmonics are shown in Figure 10.14. Slowly varying functions
can be approximated relatively accurately using only a small number of terms
from the series. Sillion et al. find that if the ideal specular term is removed, the
remaining radiance distribution due to glossy and Lambertian diffuse reflection
can usually be adequately approximated by computing coefficients for the first
100 or so terms of the series.
Representing the BRDF, as opposed to the directional radiance, is more
complex, since the outgoing distribution represented by the BRDF varies as a
function of incoming direction. Sillion et al. approximate the distribution for a
single incoming direction using approximately the first 80 spherical harmonics.
However, since this outgoing distribution changes as a function of the incom-
ing direction, the distributions must be represented for all incoming directions.
Assuming isotropic reflection, this variation depends only on a single value, the
angle between the incoming direction and the surface normal. The variation of
the distribution with this angle is interpolated using a one dimensional cubic
Figure 10.14: The first three spherical harmonics. Coutesy of Franois Sillion,
Cornell University Program of Computer Graphics.
where the dot represents the hemisphere of directions, L(x, ) is the radiance
r
distribution at x and ( , ) is the bidirectional reflectance function for incoming
r
energy from direction .
Numerical integration over the element i is performed, as in Wallace et
al.s ray-shooting form factor algorithm [247], by breaking the element into N
smaller delta areas, A. The resulting summation over the delta areas is
r cos X cos Xj r
N
L(x, ) =
j=1
L( x j , j )
r 2j
r( j , )V (x, x j )dA j (10.23)
The visibility of each delta area from a node i is determined by shooting a ray.
The steps for updating the radiance distribution at a node at x due to the current
source element i are given in Figure 10.15.
The addition of several contributions to a node's cumulative radiance distri-
bution is shown in Figure 10.16. Since the radiance distribution and the BRDF
Constant basis functions can be defined over any (area area). In other
words, the radiance from area i to area j is approximated as constant over the
two areas. Given this approximation of the radiance field, one can derive the
relation,
L jk = E jk + Lij Rkji (10.24)
i
where, Ejk is the emitted radiance from area j to area k and Rkji is the area
reflectance of area j in direction k due to light from area i. Putting the definition
of area reflectance aside for a moment, the above relation can be stated as: The
radiance of area j in the direction of area k is equal to the emitted radiance
of area j in the k direction plus the sum of the radiance of ALL areas i in the
direction of area j multiplied times the area reflectance Rkji.
Equation 10.24 is analogous to the original radiosity equation for diffuse sur-
faces. The biggest difference is the area reflectance term, Rkji, which accounts
for the BRDF as well as the geometric and visibility relationships between areas
j and k and between areas j and i. The derivation of this term is not pursued
here; the reader is referred to [14]. The result is given as
Ai Aj Ak
f r (x, x , x )G(x, x )G(x x )dx dx dx
Rijk =
Ai Aj
G(x, x )dx dx (10.25)
10.2.6 Transmission
Although only reflection has been discussed so far, surfaces may also transmit
light. Transmission can be described by a bidirectional transmission distribu-
tion function (BTDF), analogous to the BRDF for reflection, defined over the
hemisphere on the reverse side of the surface. As in the case of reflection,
transmission can be separated into Lambertian diffuse (translucency), glossy,
and ideal specular parts.
Note that the BTDF describes the interaction only at the interface between
the two transport media (for example, the air and glass). It does not take
into account absorption within the transmitting material, which depends on the
Translucency
Figure 10.17: A fraction of the light arriving at the front of a translucent surface
is transmitted and radiated from the back of the element with an ideal diffuse
distribution. Similarly, a fraction of light arriving at the back of a translucent
element is radiated from the front.
It is possible to account for all paths in L(S|D)*E using only eye-ray tracing
or only a finite element approach. Kajiyas path tracing algorithm provides an
example of the former approach, while Immels global cube radiosity algorithm
is an example of the latter. Neither is entirely satisfactory. Eye-ray tracing has
the advantage that the number of paths to be traced is reduced based on the
eye direction. Directional reflection can be sampled as finely as desired with no
storage penalty. However, for diffuse reflection, a large number of paths must
be sampled, and images tend to be noisy (see the Monte Carlo image in color
plate 1, for example).
The finite element approach reduces the number of paths that must be traced
for diffuse reflection by averaging the effect of paths over the surface. How-
ever, this approach requires excessive storage for highly directional reflection,
as demonstrated by [132] (see Figure 10.13).
Two-pass methods abandon strict adherence to a single strategy; instead,
they use each strategy to handle the category of paths for which it is most
Figure 10.18: Image computed using translucent elements to model the lamp-
shade. Courtesy of Peter Shirley, University of Indiana.
Figure 10.19: Use of the reflection frustum during the rendering pass to sample
a highly directional BRDF.
The two-pass algorithm described by Sillion and Puech [218] differs from that
of Wallace et al. in that recursive ray tracing is used to compute extended form
factors in the first pass, which allows the inclusion of DS*D sequences (see
Figure 10.20). Eye-ray tracing is used to handle ideal specular reflection in the
second pass. Sillion and Puech point out that distribution ray tracing could be
used to include paths containing glossy reflection as well.
The algorithm of Sillion et al. [217] (described earlier in section 10.2.4)
in which glossy reflection is approximated using spherical harmonics, is also
Figure 10.20: Use of recursive ray tracing to compute extended form factors dur-
ing the first pass of Sillions two pass algorithm. Sillion uses a single projection
plane rather than the five-faced hemicube to compute form factors.
incorporated into a two-pass method. In this case completing the solution re-
quires only the use of eye-ray tracing in the second pass to handle S*E path
segments consisting of ideal Specular interactions. This algorithm accounts (ap-
proximately) for all paths in L(S|D)*E.
Glossy and ideal specular reflections can be incorporated into the first pass
using an approach analogous to extended form factors. Instead of computing
and storing the radiance for directionally reflecting surfaces, rays that encounter
specular surfaces are traced recursively until they reach a diffuse surface. During
the second pass, eye-rays are traced to account for segments of paths that start
at a diffuse surface and interact with specular surfaces before reaching the eye
(DS*E path segments).
Color plate 42 was produced by Shirley using this approach. Note the caus-
tics on the table top, which are produced by S*DE path segments refracted
through the wine glass. These are computed during the light-ray pass. The re-
fractions and reflections visible in the wine glass itself are DS*E path segments
followed during the eye-ray pass. In addition to tracing eye-rays to follow spec-
ular reflection, Shirley also computes LDE paths, i.e., the direct illumination
of diffuse surfaces, at each pixel during rendering (this approach is discussed in
greater detail in Chapter 9). Shirley uses Arvos illumination map data structure
[12] to store incident power on diffuse surfaces.
Heckberts rex algorithm uses the same basic light-ray tracing strategy as
Shirleys algorithm, as well as a more powerful adaptive version of the illumina-
tion map data structure (this algorithm is described in more detail in Chapter 8).
The images in Figures 8.30 and 8.31 were computed using Heckberts bidirec-
tional ray tracing algorithm.
The multi-pass algorithm of Chen et al. [52] uses both extended form factors
and light-ray tracing. A radiosity solution using extended form factors is first
performed to provide an initial low-frequency approximation of all L(D|S)*E
specular reflectances
polished mirror: 0.99
polished aluminum: 0.65
transmission coefficients
clear glass: 0.80 to 0.99 (basically specular)
solid opal glass: 0.15 to 0.40 (basically diffuse.)
Research is also being conducted to develop new methods for measuring the
BRDF of surfaces and for generating the BRDF from simulated surface models
[253, 263].
9
This exposition follows that of Rushmeier in [198].
Figure 10.22: Phenomena affecting the radiance entering and exiting a differ-
ential volume along a path through a participating medium.
dL L + L + S
t a e 2
0 0 L ( )f ( ) sin d d (10.28)
ds 4
expensive to approximate accurately, since the light just passing through a point
typically varies extremely rapidly with direction.
This problem can be avoided by formulating the solution to equation 10.28
in a way that separates out the contributions of in-scattering and emission along
the path. This observation is essentially the same as that used to separate surface
reflection into ideal diffuse and mirror specular terms. Solving equation 10.28
for L(s) gives the integral equation
s
L(s) = L(0)(0, s) + (s, s)J(s)t(s)ds (10.29)
0
where J(s') is a function describing the radiance added to the path at each point
s' due to emission and in-scattering, and (s1, s2) is the integrated extinction
coefficient t along the path from s1 to s2 .
S2
S1 t (s)ds
(s1 , s2 ) = e (10.30)
(s1 , s2 ) = e t s1 s2 (10.31)
The first term in equation 10.29 accounts for what is seen through the
medium; it consists of the radiance of the surface at the beginning of the path
attenuated by absorption and scattering along the path. This requires only an
approximation of the radiosity at the surface at which the path begins, and thus
eliminates the need to approximate that highly directional component at every
point in the volume.
The second term in equation 10.29 accounts for energy accrued along the
path as the result of in-scattering and emission, which are represented by the
function J(s). J(s), called the source function, varies much more slowly over
the volume than L(s) and can be approximated relatively inexpensively. The
problem is thus to compute J(s).
Assuming the participating media has been divided into m volume elements
and the surfaces into n elements, then the radiosity of a surface element, i,
includes contributions from all other surfaces, j, and all volume elements, k:
n m
Bi Ai = Ei Ai + i B j F jiSS +
Bk FkiVS (10.32)
j=1 l=1
where F jiSS
is the surface-to-surface form factor and is the volume-to- FkiVS
surface form factor. Likewise, the radiosity of a volume element Vk , includes
contributions from all surface elements j and all other volumes l
n m
4 t Bk V k = 4 a Ek V k + k
j=1
B j F jkSV +
l=1
Bl FlkVV
(10.33)
where F jkSV is the surface-to-volume form factor and FlkVV is the volume-to-
volume form factor. The factor k is the scattering albedo of volume Vk ,
similar to the diffuse reflectivity term for surfaces. The computation of volume-
to-volume and volume-to-surface form factors using the hemicube is shown in
Figure 10.24.
The various form factors are similar to those for conventional radiosity,
except that they include the effect of attenuation due to transport through the
medium. The form factor FijSS between two surface elements, Si and Sj , is
given by
cos i cos j
FijSS =
Ai Aj
(x i , x j )
r2
dA j dAi (10.34)
where () (see equation 10.30) reduces the transfer between the respective points
on the two elements i and j. Note also, there is no division by area in this form.
The volume-to-surface form factor is
cos j t,k
FkjVS =
(x , x )
V k Aj
k j
r2
dA j dV k (10.35)
where t,k is the constant t for volume k. The volume-to-volume form factor
is given by
t,k t,l
FklVV =
V k Vl
(x k , x l )
r2
dV l dV k (10.36)
The form factors may be computed using existing algorithms with little
modification. The principle requirement is the evaluation of the path integrals.
In Rushmeiers modified hemicube algorithm, is computed at each hemicube
pixel, based on the distance to the surface or volume to which the form factor
is being computed (see equations 10.30 and 10.31).
Rendering the solution of the zonal method is equivalent to the volume ren-
dering methods developed for scientific visualization applications [75, 136, 149,
150, 264]. Volume rendering for hierarchical volumes is explored in [145]. Dur-
ing rendering, the equation 10.29 is evaluated for each pixel. First, the contribution
of the radiosity of the visible surface is computed, taking into account attenu-
ation by computing as above. Then the contribution to the total radiance of
every volume element through which the path travels is computed, also taking
into account the attenuation based on the distance from the eye to the volume
element. The final radiance for the pixel is the sum of all these contributions.
Since J is computed independently of the view, rendering another view requires
only recomputing these path integrals.
As in conventional radiosity, constant volume elements are not adequate for
rendering. Trilinear interpolation can be used to smooth the volume radiosities
during rendering. Results of this method are shown in color plates 1f and 48.
The zonal method has been extended by Rushmeier [198] to this media
exhibiting weak anisotropic scatter, where volume-to-volume interactions are
assumed insignificant. It has been further extended by Bhate and Tokuta [28]
to the case of more general anisotropic scatter, using spherical harmonics to
approximate the directionally dependent phase function.
Chapter 11
11.1 Applications
In general, radiosity is most useful in applications where ideal diffuse interreflec-
tion is important and the geometry is static. The view-independent approach is
particularly valuable when the exploration of a three-dimensional model is re-
quired, rather than the production of a single static image.
When incorporating any global illumination algorithm into an application,
it is important to insulate the user from the technical details of the procedure.
Specifying a mesh resolution or adaptive subdivision criterion forces the user to
learn entirely new concepts unrelated to his or her work. To the extent that the
user is given control over the solution, results must be predictable. Radiosity
solutions for complex environments are too expensive to allow trial and error as
a reasonable approach.
These requirements have important consequences for the development of
radiosity algorithms. Meshing algorithms must be extremely robust. Where
parameters are necessary, they must map clearly to quality and cost. The time-
quality tradeoff should be predictable, and quality should degrade gracefully
with decreasing cost. For example, a lower-cost solution might provide less
shadow detail, but should not contain disturbing artifacts.
In the next sections, several radiosity applications will be discussed. This
will highlight some of the strengths of the radiosity approach, as well as some
of the areas that need attention.
Positioning of lights.
Figure 11.3: A second view from the same interior design study. Image courtesy
of David L. Munson Hellmuth Obata & Kassabaum Architects Inc.
Theatrical Lighting
Theatrical lighting is a special case of lighting design that has very particular
requirements. Although light sources are limited to five or so basic types, a
theatrical production typically uses hundreds of individual lights. These are
turned on and off frequently in different combinations. The continuous variation
of light intensity over time is often aesthetically important.
The circumstances under which the lighting for a particular production is
designed are usually demanding. Sets are constructed at the last minute. As a
result, the actual appearance of the lighted set cannot be fully evaluated until just
prior to the first performance. Computer simulation thus seems ideally suited to
the design of stage lighting.
Several features of the theatrical lighting design problem make radiosity a
potentially useful tool. The model to be illuminated is normally static. The
scene may need to be evaluated from a number of viewpoints throughout the
audience seating. These views are taken from outside the scene, so there is a
fairly well-defined limit to the shading detail required.
On the other hand, there are several aspects of the problem that require
modifications to the conventional radiosity approach. For example, the light
sources have very specific characteristics that must be modeled correctly. The
sources are typically highly directional and thus quite different from ideal diffuse
emitters handled by conventional radiosity. Dorsey [74fldescribes modified form
factor formulae (similar to those discussed in Chapter 10).
Although the geometry of the scene is static, this is not true of the lighting.
The complexity of the problem is suggested by the diagram in Figure 11.4,
which specifies the lighting changes for different banks of lights over time for a
production at the Metropolitan Opera House. Fortunately, most lighting changes
involve changes in emitted power rather than repositioning or repointing of the
light. The static positioning of lights allows the effect of various lights or
combinations of lights to be computed independently. For any given lighting
specification, the independent solutions can then be rapidly scaled appropriately
and summed to provide the total radiosity [73fl.
Dorseys program includes extensive tools for lighting specification (see
Figure 11.5: The specification and pointing of lights in an application for op-
eratic lighting design. Courtesy of Julie 0B. Dorsey Program of Computer
Graphics Cornell University.
Figure 11.5) and for viewing the solution. Color plates 53 and 54 and the image
on the back cover show results generated by this application. The solutions were
computed using progressive radiosity with ray traced form factors. Rendering
was performed using a stochastic ray tracer. Texture mapping (discussed in
Chapter 9) has also been used very effectively to add detail during rendering.
Lighting Optimization
Kawai et al. [137] have developed techniques that invert the radiosity simulation
paradigm. Given a geometric description of an environment and the illumination
requirements or a desired appearance for the scene, their algorithm addresses
the question of how the lighting parameters should be set to achieve these goals.
They describe a method for designing the illumination in an environment by
applying optimization techniques to a radiosity-based image synthesis system.
The user is able to specify the illumination in terms of subjective criteria such as
pleasantness and privateness. Other goals such as minimizing total energy
consumption or maintaining a minimum illumination on a work surface can
also be specified. An optimization of lighting parameters is then performed
based on the user-specified constraints and objectives for the illumination of the
environment. The system solves for the best possible settings for light-source
emissivities, element reflectivities, and spot-light directionality parameters.
ple, in the case of radiosity, one might ask whether the assumption of ideal
diffuse reflection is too restrictive to be useful for modeling real environments.
Second, experimental validation tests the accuracy of numerical methods and
algorithms.
A further issue that requires experimental investigation is the quality of
the visual experience provided by image synthesis algorithms. The perceived
realism of images is very difficult to quantify, but this is nevertheless a crucial
criterion in the evaluation of algorithms for certain applications.
Meyer et al. [167] have made preliminary efforts toward an experimental
validation of the radiosity method. They have performed two sets of experiments
with the familiar red, white, and blue box (similar to the boxes in color plate 1).
The first set of these experiments compares the results of a radiosity simula-
tion to radiometric measurements of a physical model. These experiments were
intended to evaluate basic assumptions of the radiosity method, particularly the
assumption of ideal diffuse reflection and emission. Measurements of the inte-
gral of irradiance were made at intervals on the open face of a box whose interior
faces were painted various colors. Illumination was provided by a diffused light
source at the center of the top of the box.
The results of the experiment indicate that the assumption of ideal diffuse
emission for the light source contributes significantly to errors in the simulation.
The experiment also demonstrates that radiosity accounts well for the effect of
diffuse interreflection or color bleeding and for the effect of occlusion, insofar
as measurement by integrating irradiance can indicate.
The second set of experiments addresses the perceived quality of radiosity
images, with the intention of seeing how close radiosity comes to creating a
visual experience identical to that experienced seeing the real .scene. Given the
limitations of existing display devices, it was necessary to simplify the problem
in several ways. For example, the light source was blocked from direct view
in both the image and the actual scene so that the limited dynamic range of the
display did not immediately give away the simulation.
In the experiment, a real scene and a simulated version were projected side
by side onto frosted glass in the backs of two view cameras (see Figure 11.7 and
color plate 5). Subjects were asked to determine which was the real scene and
to rate the relative quality of features like shadows and color (color plates 6 and
7). The simulated image was chosen as the real scene approximately 50% of the
time (for untrained observers), indicating that the synthesized image achieved
the goal of perceptual realism in this highly constrained case. Color plates 8
and 9 are the result of exposing film placed in the view cameras. It should be
noted that the reader is not getting the same visual experience as the subjects
in the experiment. Film processing introduces its own distortions, as does the
reproduction of the photograph in print. In addition, viewing light reflected from
Figure 11.7: The experimental setup for perceptual validation of a simple ra-
diosity solution.
the pages of a book is different than viewing light transmitted through frosted
glass. Finally, the images presented to the experimental observer were upside
down due to camera lens optics.
These experiments are clearly just a beginning. However, they raise many of
the issues that any experimental validation must address and provide preliminary
answers to some of them. These issues include the type of radiometric device
appropriate for the physical measurements, the physical quantities that should be
measured, and the problem of constructing a physical model and measuring its
properties to define an equivalent computer model. For perceptual experiments,
there are additional difficult questions, such as how to present the comparisons
without biasing the result and how to obtain detailed information about what
features contribute or detract from realism.
BRDF of real surfaces and for generating the BRDF from simulated surface
models. Ward [253] discusses an experimental setup for measuring the BRDF
of real materials. Cabral, et al. [41] describe a method for computing the BRDF
from bump maps specifying small scale surface geometry. Westin et al. [263]
describe an algorithm for computing the BRDF based on detailed geometric
models of materials such as cloth or brushed metal. As image synthesis algo-
rithms become more accurate, their dependence on valid data will become more
critical and this area of research will gain increasing importance.
11.3.4 Meshing
As evident from the discussion of applications, there is a great need for robust,
fast, and predictable meshing algorithms. One of the largest hindrances to the
adoption of radiosity for mainstream applications is the difficulty of specifying
meshing parameters (and the trial and error required to get good results).
Meshing for radiosity has been until recently, to use Heckberts words,
something of a black art [120]. Although this state of affairs has improved,
as demonstrated by the survey of meshing algorithms in Chapters 6 and 8, there
are many techniques for finite element meshing that have yet to be investigated
for radiosity.
Discontinuity meshing has made impressive gains in improving predictabil-
ity and in eliminating the need for trial and error in setting mesh parameters.
The development of discontinuity meshing algorithms that are efficient and prac-
tical for complex environments is an important direction to investigate. There
is also room to improve a posteriori approaches, which may reduce the need to
determine exact boundaries a priori.
11.3.5 Hierarchy
As noted in section 11.1.1, architectural models, for which radiosity is otherwise
well suited, can easily exceed 100,000 polygons. Despite many improvements
in efficiency, radiosity algorithms are still essentially O(n2) in the number of
polygons. Fortunately, this does not seem to be an inherent lower bound on the
efficiency of the technique.
The hierarchical methods described in Chapter 7 support the view that the
cost of radiosity can be reduced. The basic concept underlying these methods
is that the interactions between two widely separated groups of elements can
be represented by a single average interaction. Current hierarchical algorithms
always start with a polygon and subdivide downward. Thus elements can be
grouped only within a polygon, and elements from different polygons cannot
be grouped together to form larger clusters. As a result, current hierarchical
methods reduce the cost of the radiosity solution in terms of the number of
elements, but the cost in the number of polygons is still O(n2). Clearly, the
next step is to cluster surfaces together, allowing interactions with multiple
objects to be treated as a single interaction where appropriate. Preliminary work
has begun in this area.
Xu [269] has used spatial substructuring to reduce the cost of the radiosity
solution. In this approach, the volume containing the environment is subdi-
vided uniformly to create subscenes. Elements within a single subscene interact
normally, but interactions between elements in neighboring subscenes are medi-
ated by special elements on the surfaces that define the subscene boundaries.
These elements record directional information about the light reflected toward
the boundary from inside the subscene. For the neighboring subscene, these
boundary elements then provide an approximation of the illumination arriving
from outside the subscene to the elements within. This approach has been used
subsequently as a basis for the parallelization of the radiosity solution [10, 239],
with each independent subscene handled by a different processor. A related
approach has also been proposed by Neumann and Kelemen [172].
Although spatial subdivision reduces the cost of the radiosity solution, the
subdivision must be specified a priori by the user. The hierarchy is inflexible and
is limited to two levels, which does not fully exploit the potential of hierarchical
methods to increase the efficiency of the solution.
The clustering algorithms developed so far are only a first step. Future work
should include automatic methods for generating the simplified geometry and
generalization of the hierarchy to multiple levels. This remains perhaps the most
important open problem for radiosity research.
Figure 11.8: A view looking down the nave of Chartres Cathedral. The model
was produced by John Lin using Hewlett-Packards ME-30 solid modeler.
11.4 Conclusion
Architects have struggled to capture the grandeur of space and light in monu-
mental structures. The renderings of such a structure in Figures 11.8 and 11.9
demonstrate that the radiosity method can produce compelling images based on
the simulation of the propagation of light.
The goal of producing convincingly realistic images of nonexistent scenes is
tantalizingly close to being achieved. However, many chapters in this exciting
research endeavor have yet to be written. As computational speeds increase
and the associated costs continue to decline, emerging applications will surely
demand more of image synthesis algorithms. We hope that this text has provided
a firm base upon which to build these future image synthesis systems and that
it will encourage the reader to become involved in this quest.
Bibliography
[1] CIE Recommendations on Uniform Color Spaces, Color-difference Equa-
tions, and Psychometric Color Terms. Bureau de la CIE, Paris, 1978.
[2] IES Lighting Handbook. 1981 Reference Edition, New York, 1981.
[3] Sweets Catalog File: Products for Engineering. McGraw-Hill, New York,
1981.
[11] ARVO, J., and KIRK, D. Fast ray tracing by ray classification. Com-
puter Graphics (SIGGRAPH 87 Proceedings) 21:4 (Aug. 1987), pp. 55
64.
[16] BARNES, J., AND HUT, P. A hierarchical O(n log n) force calculation
algorithm. Nature 324 (1986), pp. 446449.
[18] BAUM, D. R., MANN, S., SMITH, K. P., AND WINGET , J. M. Mak-
ing radiosity usable: Automatic preprocessing and meshing techniques for
the generation of accurate radiosity solutions. Computer Graphics (SIG-
GRAPH 91 Proceedings) 25:4 (July 1991), pp. 5160.
[26] BEYLKIN, G., COIFMAN, R., AND ROKHLIN, V. Fast wavelet trans-
forms and numerical algorithms I. Communications on Pure and Applied
Mathematics 44 (1991), pp. 141183.
[33] BOENDER, E. Finite Element Mesh Generation from CSG Models. PhD
thesis, Dept. of Technical Math. and Informatics, Delft University of Tech-
nology, Netherlands, 1992.
[47] CHANEY, J., RAMIDAS, V., RODRIGUEZ, C., AND WU, M., Eds.
Thermophysical Properties Research Literature Retrieval Guide 1900-
1980. IFI/Plenum, New York, 1982.
[49] CHEN, H., AND WU, E.-H. An efficient radiosity solution for bump
texture generation. Computer Graphics (SIGGRAPH 90 Proceedings)
24:4 (Aug. 1990), pp. 125134.
[54] CHIN, N., AND FEINER, S. Near real-time shadow generation using
bsp trees. Computer Graphics (SIGGRAPH 89 Proceedings) 23:3 (July
1989), pp. 99106.
[55] CHIN, N., AND FEINER, S. Fast object-precision shadow generation for
area light source using bsp trees. In Computer Graphics, Special Issue
(Proceedings 1992 Symposium on Interactive 3D Graphics) (Cambridge,
Mass., Mar. 1992), ACM Press, pp. 2130.
[56] CLOUGH, R., AND TOCHER, J. Finite element stiffness matrices for
analysis of plate bending. In Matrix Methods in Structural Mechanics
(Proceedings of the conference held at Wright-Patterson Air Force Base,
Ohio, 26-28 October 1965) (1966), pp. 515545.
[77] DRUCKER, S. M., AND SCHRDER, P. Fast radiosity using a data par-
allel architecture. In Third Eurographics Workshop on Rendering (Bristol,
uk, May 1992), pp. 247258.
[80] FARIN, G. Curves and Surfaces for Computer Aided Geometric Design.
Academic Press, Boston, 1988.
[84] FOLEY, J. D., VAN D AM, A., F EINER, S. K., AND HUGHES, J. F.
Computer Graphics, Principles and Practice, 2nd Edition. Addison-
Wesley, Reading, Massachusetts, 1990.
[85] FORSYTH, D., AND ZISSERMAN, A. Shape from shading in the light
of mutual illumination. Image and Vision Computing 8:1 (Feb. 1990),
pp. 4249.
[88] FUCHS, H., POULTON, J., EYLES, J., G REER, T., GOLDFEATHER,
J., ELLSWORTH , D., MOLNAR, S., TURK, G., TEBBS, B., AND
ISRAEL, L. Pixel-planes 5: A heterogeneous multiprocessor graphics
system using processor-enhanced memories. Computer Graphics (SIG-
GRAPH 89 Proceedings) 23:3 (July 1989), pp. 7988.
[95] GIFFORD, S. Data Parallel Two Pass Rendering. Naval Research Lab-
oratory Technical Report, Aug. 1991.
[107] GUITTON, P., ROMAN, J., AND S CHLICK, C. Two parallel approaches
for a progressive radiosity. In Second Eurographics Workshop on Render-
ing (Barcelona, Spain, May 1991).
[111] HAINES, E,. A., AND GREENBERG D. P. The light buffer: A shadow-
testing accelerator. IEEE Computer Graphics and Applications 6:9 (Sept.
1986), pp. 616.
[127] HEWITT, H., AND VAUSE, A. S., Eds. Lamps and Lighting. American
Elsevier, New York, 1964.
[129] HORN, B. K. P., Ed. Shape from Shading. MIT Press, 1989.
[186] PUECH, C., SILLION, F., AND VEDEL., C. Improving interaction with
radiosity-based lighting simulation programs. Computer Graphics (Pro-
ceedings of the 1990 Symposium on Interactive 3D Graphics) 24:2 (Mar.
1990), pp. 5157.
[200] RUSHMEIER , H. E., and torrance, K. E. The zonal method for cal-
culating light intensities in the presence of a participating medium. Com-
puter Graphics (SIGGRAPH 87 Proceedings) 21:4 (July 1987), pp. 293
302.
[206] SCHRDER, P., AND HANRAHAN, P. A closed form expression for the
form factor between two polygons. Tech. Rep. Cs-40493, Department
of Computer Science, Princeton University, Jan. 1993.
[210] SHAO, M.-Z., PENG, Q.-S., AND LIANG, Y.-D. A new radiosity ap-
proach by procedural refinements for realistic image synthesis. Computer
Graphics (SIGGRAPH 88 Proceedings) 22:4 (Aug. 1988), pp. 93101.
[214] SHIRLEY, P. Radiosity via ray tracing. In Graphics Gems II, J. Arvo,
Ed. AP Professional, Boston, 1991, pp. 306310.
[219] SMITH, F. W., Ed. Crc Handbook of Marine Science. Crc Press,
Cleveland, Ohio, 1974.
[221] SPARROW, E. A new and simpler formulation for radiative angle factors.
Transactions of the ASME, The Journal of Heat Transfer 85:2 (1963),
pp. 8188.
[245] VILAPLANA, J., AND PUEYO, X. Exploiting coherence for clipping and
view transformations in radiosity algorithms. In Photorealism in Computer
Graphics (Proceedings Eurographics Workshop on Photosimulation, Re-
alism and Physics in Computer Graphics, Rennes, France, Jun. 1990),
K. Bouatouch and C. Bouville, Eds., Springer-Verlag, pp. 137150.
[248] WANG, C. Physically correct direct lighting for distribution ray tracing.
In Graphics Gems III, D. Kirk, Ed. AP Professional, Boston,, 1992,
pp. 307313.
[249] W ANG, Y., AND DAVIS, W. A. Octant priority for radiosity image
rendering. In Proceedings of Graphics Interface 90 (Toronto, Ontario,
May 1990), Canadian Information Processing Society, pp. 8391.
[269] XU, H., P ENG, Q.-S., AND LIANG, Y.-D. Accelerated radiosity
method for complex environments. In Visual Computing: Integrating
Computer Graphics with Computer vision (Proceedings of CG Interna-
tional 92) (Tokyo, Sept. 1989), Springer-Verlag, pp. 895905.
[274] ZISSERMAN, A., GIBLIN, P., AND B LAKE, A. The information avail-
able to a moving observer from specularities. Image and Vision Computing
7:1 (1989), pp. 3842.
Index