Chapter 10
RADIOSITY METHOD
The radiosity metho d is based on the numerical solution of the shading
equation by the nite element metho d. It sub divides the surfaces into
small elemental surface patches. Supp osing these patches are small, their
intensity distribution over the surface can b e approximated by a constant
value which dep ends on the surface and the direction of the emission. We
can get rid of this directional dep endency if only di use surfaces are allowed,
since di use surfaces generate the same intensity in all directions. This is
exactly the initial assumption of the simplest radiosity mo del, so we are also
going to consider this limited case rst. Let the energy leaving a unit area
of surface i in a unit time in all directions b e B , and assume that the light
i
density is homogeneous over the surface. This light density plays a crucial
role in this mo del and is also called the radiosity of surface i.
The dep endence of the intensityon B can b e expressed by the following
i
argument:
1. Consider a di erential dA element of surface A. The total energy
leaving the surface dA in unit time is B dA, while the ux in the
solid angle d! is d=IdA cos d! if is the angle b etween the
surface normal and the direction concerned.
2. Expressing the total energy as the integration of the energy contribu-
tions over the surface in all directions and assuming di use re ection 265
266 10. RADIOSITY METHOD
only,we get:
=2
2 2 2
Z Z Z Z
d 1
cos sin dd=I I cos d! = I B = d! =
dA d!
=0 =0
(10:1)
since d! = sin dd .
Consider the energy transfer of a single surface on a given wavelength.
The total energy leaving the surface (B dA ) can b e divided into its own
i i
emission and the di use re ection of the radiance coming from other surfaces ( gure 10.1).
Ej dA j
Φ ji
B i B j
dA i E i
Figure 10.1: Calculation of the radiosity
The emission term is E dA if E is the emission density which is also
i i i
assumed to b e constant on the surface.
The di use re ection is the multiplication of the di use co ecient % and
i
that part of the energy of other surfaces which actually reaches surface i.
Let F b e a factor, called the form factor, which determines that fraction
ji
of the total energy leaving surface j which actually reaches surface i.
Considering all the surfaces, their contributions should b e integrated,
which leads to the following formula of the radiosity of surface i:
Z
B dA = E dA + % B F dA : (10:2)
i i i i i j ji j
10. RADIOSITY METHOD 267
Before analyzing this formula any further, some time will b e devoted to
the meaning and the prop erties of the form factors.
The fundamental law of photometry (equation 3.15) expresses the en-
ergy transfer b etween two di erential surfaces if they are visible from one
another. Replacing the intensityby the radiosity using equation 10.1, we
get:
dA cos dA cos dA cos dA cos
i i j j i i j j
d=I = B : (10:3)
j
2 2
r r
If dA is not visible from dA , that is, another surface is obscuring it from
i j
dA or it is visible only from the \inner side" of the surface, the energy ux
j
is obviously zero. These two cases can b e handled similarly if an indicator
variable H is intro duced:
ij
8
1ifdA is visible from dA
<
i j
(10:4) H =
ij
:
0 otherwise
Since our goal is to calculate the energy transferred from one nite sur-
face (A ) to another (A ) in unit time, b oth surfaces are divided into
j i
in nitesimal elements and their energy transfer is summed or integrated,
thus:
Z Z
dA cos dA cos
i i j j
= B H : (10:5)
ji j ij
2
r
A A
i j
By de nition, the form factor F is a fraction of this energy and the total
ji
energy leaving surface j ( B A ):
j j
Z Z
dA cos dA cos 1
i i j j
H F = : (10:6)
ij ji
2
A r
j
A A
j i
It is imp ortant to note that the expression of F A is symmetrical with
ji j
the exchange of i and j , which is known as the recipro city relationship:
F A = F A : (10:7)
ji j ij i
We can now return to the basic radiosity equation. Taking advantage
of the homogeneous prop erty of the surface patches, the integral can b e
replaced by a nite sum:
X
B A = E A + % B F A : (10:8)
i i i i i j ji j j
268 10. RADIOSITY METHOD
Applying the recipro city relationship, the term F A can b e replaced
ji j
by F A :
ij i
X
B A = E A + % B F A : (10:9)
i i i i i j ij i
j
Dividing by the area of surface i,we get:
X
B = E + % B F : (10:10)
i i i j ij
j
This equation can b e written for all surfaces, yielding a linear equation
where the unknown comp onents are the surface radiosities (B ):
i
3 3 2 3 2 2
E B 1 % F % F ::: % F
1 1 1 11 1 12 1 1N
7 7 6 7 6 6
E B % F 1 % F ::: % F
7 7 6 7 6 6
2 2 2 21 2 22 2 2N
7 7 6 7 6 6
7 7 6 7 6 6
: : :
7 7 6 7 6 6
(10:11) =
7 7 6 7 6 6
: : :
7 7 6 7 6 6
7 7 6 7 6 6
5 5 4 5 4 4
: : :
E B % F % F ::: 1 % F
N N N N 1 N N 2 N NN
or in matrix form, having intro duced matrix R = % F :
ij i ij
(1 R) B = E (10:12)
(1 stands for the unit matrix).
The meaning of F is the fraction of the energy reaching the very same
ii
surface. Since in practical applications the elemental surface patches are
planar p olygons, F is 0.
ii
Both the numb er of unknown variables and the numb er of equations are
equal to the numb er of surfaces (N ). The solution of this linear equation
is, at least theoretically, straightforward (we shall consider its numerical as-
p ects and diculties later). The calculated B radiosities represent the light
i
density of the surface on a given wavelength. Recalling Grassman's laws,
to generate color pictures at least three indep endentwavelengths should b e
selected (say red, green and blue), and the color information will come from
the results of the three di erent calculations.
10. RADIOSITY METHOD 269
Thus, to sum up, the basic steps of the radiosity metho d are these:
1. F form factor calculation.
ij
2. Describ e the light emission (E ) on the representativewavelengths, or
i
in the simpli ed case on the wavelength of red, green and blue colors.
Solve the linear equation for each representativewavelength, yielding
1 2 n
B , B ... B .
i i i
3. Generate the picture taking into account the camera parameters by
any known hidden surface algorithm. If it turns out that surface i is
visible in a pixel, the color of the pixel will b e prop ortional to the cal-
culated radiosity, since the intensity of a di use surface is prop ortional
to its radiosity (equation 10.1) and is indep endent of the direction of
the camera.
Constant color of surfaces results in the annoying e ect of faceted ob jects,
since the eye psychologically accentuates the discontinuities of the color
distribution. To create the app earance of smo oth surfaces, the tricks of
Gouraud shading can b e applied to replace the jumps of color by linear
changes. In contrast to Gouraud shading as used in incremental metho ds,
in this case vertex colors are not available to form a set of knot p oints
for interp olation. These vertex colors, however, can b e approximated by
averaging the colors of adjacent p olygons (see gure 10.2).
B2 B1
B3 B4 BB+++ BB B=1234
v 4
Figure 10.2: Color interpolation for images created by the radiosity method
Note that the rst two steps of the radiosity metho d are indep endent of the actual view, and the form factor calculation dep ends only on the
270 10. RADIOSITY METHOD
geometry of the surface elements. In camera animation, or when the scene
is viewed from di erent p ersp ectives, only the third step has to b e rep eated;
the computationally exp ensive form factor calculation and the solution of
the linear equation should b e carried out only once for a whole sequence.
In addition to this, the same form factor matrix can b e used for sequences,
when the lightsources have time varying characteristics.
10.1 Form factor calculation
The most critical issue in the radiosity metho d is ecient form factor cal-
culation, and thus it is not surprising that considerable research e ort has
gone into various algorithms to evaluate or approximate the formula which
de nes the form factors:
Z Z
1 dA cos dA cos
i i j j
F = : (10:13) H
ij ij
2
A r
i
A A
i j
As in the solution of the shading problem, the di erent solutions represent
di erent compromises b etween the con icting ob jectives of high calculation
sp eed, accuracy and algorithmic simplicity.
In our survey the various approaches are considered in order of increasing
algorithmic complexity, which, interestingly, do es not follow the chronolog-
ical sequence of their publication.
10.1.1 Randomized form factor calculation
The randomized approach is based on the recognition that the formula
de ning the form factors can b e taken to represent the probabilityofa
quite simple event if the underlying probability distributions are de ned
prop erly.
An appropriate sucheventwould b e a surface j b eing hit by a particle
leaving surface i. Let us denote the event that a particle leaves surface dA
i
by PLS(dA ). Expressing the probability of the \hit" of surface j by the
i
total probability theorem we get:
Z
Prfhit A g = Prfhit A j PLS(dA )gPrfPLS(dA )g: (10:14)
j j i i
A i
10.1. FORM FACTOR CALCULATION 271
The hitting of surface j can b e broken down into the separate events of
hitting the various di erential elements dA comp osing A . Since hitting
j j
of dA and hitting of dA are exclusiveevents if dA 6= dA :
k l k l
Z
Prfhit A j PLS(dA )g = Prfhit dA j PLS(dA )g: (10:15)
j i j i
A
j
Now the probability distributions involved in the equations are de ned:
1. Assume the origin of the particle to b e selected randomly by uniform
distribution:
1
dA : (10:16) PrfPLS(dA )g =
i i
A
i
2. Let the direction in which the particle leaves the surface b e selected
by a distribution prop ortional to the cosine of the angle b etween the
direction and the surface normal:
cos d!
i
Pr fparticle leaves in solid angle d! g = : (10:17)
The denominator guarantees that the integration of the probabilityover
the whole hemisphere yields 1, hence it deserves the name of probability
2
density function. Since the solid angle of dA from dA is dA cos =r
j i j j
where r is the distance b etween dA and dA , and is the angle of the
i j j
surface normal of dA and the direction of dA , the probability of equa-
j i
tion 10.15 is:
Prfhit dA j PLS(dA )g =
j i
PrfdA is not hidden from dA ^ particle leaves in the solid angle of dA g
j i j
H dA cos cos
ij j j i
= (10:18)
2
r
where H is the indicator function of the event\dA is visible from dA ".
ij j i
Substituting these into the original probability formula:
Z Z
1 dA cos dA cos
i i j j
Prfhitg = : (10:19) H
ij
2
A r
i
A A
i j
This is exactly the same as the formula for form factor F . This proba-
ij
bility,however, can b e estimated by random simulation. Let us generate n
272 10. RADIOSITY METHOD
particles randomly using uniform distribution on the surface i to select the
origin, and a cosine density function to determine the direction. The origin
and the direction de ne a ray whichmayintersect other surfaces. That
surface will b e hit whose intersection p oint is the closest to the surface from
which the particle comes. If sho oting n rays randomly surface j has b een
hit k times, then the probability or the form factor can b e estimated by
j
the relative frequency:
k
j
F : (10:20)
ij
n
Two problems have b een left unsolved:
How can we select n to minimize the calculations but to sustain a
given level of accuracy?
How can we generate uniform distribution on a surface and cosine
density function in the direction?
Addressing the problem of the determination of the necessary number of
attempts, we can use the laws of large numb ers.
The inequality of Bernstein and Chebyshev [Ren81] states that if the
absolute value of the di erence of the event frequency and the probability
is exp ected not to exceed with probability , then the minimum number
of attempts (n) is:
9 log 2=
n : (10:21)
2
8
The generation of random distributions can rely on random numb ers of
uniform distribution in [0::1] pro duced by the pseudo-random algorithm of
programming language libraries. Let the probability distribution function of
the desired distribution b e P (x). A random variable x which has P (x) prob-
ability distribution can b e generated by transforming the random variable r
that is uniformly distributed in [0::1] applying the following transformation: