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-

(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 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:

1

x = P (r ): (10:22)

10.1. FORM FACTOR CALCULATION 273

10.1.2 Analytic and geometric metho ds

The following algorithms fo cus rst on the inner section of the double in-

tegration, then estimate the outer integration. The inner integration is

given some geometric interpretation which is going to b e the base of the

calculation. This inner integration has the following form:

Z

cos   cos 

i j

d F = H  dA : (10:23)

i ij ij j

2

  r

A j

∆ A j

dA j φ φ cos j j dA j r2 N φ φ φ i dA cosj cos i j 1 r2 r

dA i

Figure 10.3: Geometric interpretation of hemisphere form factor algorithm

Nusselt [SH81] has realized that this formula can b e interpreted as pro-

jecting the visible parts of A onto the unit hemisphere centered ab ove

j

dA , then pro jecting the result orthographically onto the base circle of this

i

hemisphere in the plane of dA (see gure 10.3), and nally calculating

i

the ratio of the doubly pro jected area and the area of the unit circle ( ).

Due to the central role of the unit hemisphere, this metho d is called the

hemisphere algorithm.

Later Cohen and Greenb erg [CG85 ] have shown that the pro jection cal-

culation can b e simpli ed, and more imp ortantly, supp orted by image syn-

thesis hardware, if the hemisphere is replaced by a half cub e. Their metho d

is called the hemicub e algorithm.

274 10. RADIOSITY METHOD

Beran-Ko ehn and Pavicic have demonstrated in their recent publication

[BKP91] that the necessary calculations can b e signi cantly decreased if a

cubic is used instead of the hemicub e.

Having calculated the inner section of the integral, the outer part must

be evaluated. The simplest way is to supp ose that it is nearly constanton

A, so the outer integral is estimated as the multiplication of the inner

i

integral at the middle of A and the area of this surface element:

i

Z Z

1 cos   cos 

i j

F = d F dA  d F = H  dA : (10:24)

ij i ij i i ij ij j

2

A   r

i

A A

i j

More accurate computations require the evaluation of the inner integral

in several p oints on A and some sort of numerical integration technique

i

should b e used for the integral calculation.

10.1.3 Analytic form factor computation

The inner section of the form factor integral, or as it is called the form factor

between a nite and di erential area, can b e written as a surface integral

inavector space, denoting the vector b etween dA and dA by ~r , the unit

i j

~

normal to dA by ~n , and the surface elementvector ~n  dA by dA :

i i j j j

Z Z Z

cos   cos  (~n  ~r )

i j i

~ ~

H  d F = H  wd~ A : dA = ~rdA =

ij i ij ij j j j

2 4

  r  j~rj

A A A

j j j

(10:25)

If we could nd a vector eld ~v , such that rot ~v = w~ , the area integral

R

~

could b e transformed into the contour integral ~vdl by Stoke's theorem.

This idea has b een followed by Hottel and Saro n [HS67], and they were

successful in providing a formula for the case when there are no o cclusions,

or the visibility term H is everywhere 1:

ij

L1

~ ~

X

1 angle(R ; R )

l l1

~ ~

d F = (R  R )  ~n (10:26)

i ij l l1 i

~ ~

2

jR  R j

l l1

l=0

where

~

1. angle(~a; b) is the signed angle b etween twovectors. The sign is p os-

~

itiveif b is rotated clo ckwise from ~a lo oking at them in the opp osite

direction to ~n , i

10.1. FORM FACTOR CALCULATION 275

2.  represents addition mo dulo L. It is a circular next op erator for

vertices,

3. L is the number of vertices of surface element j ,

~

4. R is the vector from the di erential surface i to the l th vertex of the

l

surface element j .

We do not aim to go into the details of the original derivation of this

formula based on the theory of vector elds, b ecause it can also b e proven

relying on geometric considerations of the hemispherical pro jection.

10.1.4 Hemisphere algorithm

First of all the result of Nusselt is proven using gure 10.3, which shows

that the inner form factor integral can b e calculated by a double pro jection

of A , rst onto the unit hemisphere centered ab ove dA , then to the base

j i

circle of this hemisphere in the plane of dA , and nally by calculating the

i

ratio of the double pro jected area and the area of the unit circle ( ). By

geometric arguments, or by the de nition of solid angles, the pro jected area

2

of a di erential area dA on the surface of the hemisphere is dA  cos  =r .

j j j

This area is orthographically pro jected onto the plane of dA ,multiplying

i

the area by factor cos  . The ratio of the double pro jected area and the

i

area of the base circle is:

cos   cos 

i j

 dA : (10:27)

j

2

  r

Since the double pro jection is a one-to-one mapping, if surface A is

j

ab ove the plane of A , the p ortion, taking the whole A surface into ac-

i j

count, is:

Z

cos   cos 

i j

H  dA = d F : (10:28)

ij j i ij

2

  r

A

j

This is exactly the formula of an inner form factor integral.

Nowwe turn to the problem of the hemispherical pro jection of a

planar p olygon. To simplify the problem, consider only one line of

~ ~

the p olygon rst, and twovertices, R and R , on it ( gure 10.4). The

l l1 hemispherical pro jection of this line is a half great circle. Since the radius

276 10. RADIOSITY METHOD

ni R l R l1+ +

+

-

Figure 10.4: Hemispherical projection of a planar polygon

of this great circle is 1, the area of the sector formed by the pro jections

~ ~

of R and R and the center of the hemisphere is simply half the angle

l l1

~ ~

of R and R . Pro jecting this sector orthographically onto the equatorial

l l1

plane, an ellipse sector is generated, having the area of the great circle sector

multipliedby the cosine of the angle of the surface normal ~n and the normal

i

~ ~

of the segment(R R ).

l l1

The area of the doubly pro jected p olygon can b e obtained by adding

and subtracting the areas of the ellipse sectors of the di erent edges, as

is demonstrated in gure 10.4, dep ending on whether the pro jections of

~ ~

vectors R and R follow each other clo ckwise. This sign value can also

l l1

b e represented by a signed angle of the twovectors, expressing the area of

the double pro jected p olygon as a summation:

L1

~ ~

X

1 (R  R )

l l1

~ ~

 angle(R ; R )  ~n : (10:29)

l l1 i

~ ~

2

jR  R j

l l1

l=0

Having divided this by  to calculate the ratio of the area of the double

pro jected p olygon and the area of the equatorial circle, equation 10.26 can

b e generated.

These metho ds have supp osed that surface A is ab ove the plane of

j

dA and is totally visible. Surfaces b elow the equatorial plane do not p ose

i

any problems, since we can get rid of them by the application of a clipping

algorithm. Total visibility, that is when visibility term H is everywhere 1, ij

10.1. FORM FACTOR CALCULATION 277

however, is only an extreme case in the p ossible arrangements. The other

extreme case is when the visibility term is everywhere 0, and thus the form

factor will obviously b e zero.

When partial o cclusion o ccurs, the computation can make use of these

two extreme cases according to the following approaches:

1. A continuous (ob ject precision) visibility algorithm is used in the form

factor computation to select the visible parts of the surfaces. Having

executed this step, the parts are either totally visible or hidden from

the given p oint on surface i.

2. The visibility term is estimated by ring several rays to surface el-

ement j and averaging their 0/1 asso ciated visibilities. If the result

is ab out 1, no o cclusion is assumed; if it is ab out 0, the surface is

assumed to b e obscured; otherwise the surface i has to b e sub divided,

and the whole step rep eated recursively [Tam92].

10.1.5 Hemicub e algorithm

The hemicub e algorithm is based on the fact that it is easier to pro ject onto

a planar rectangle than onto a spherical surface. Due to the change of the

underlying geometry, the double pro jection cannot b e exp ected to provide

the same results as for a hemisphere, so in order to evaluate the inner form

factor integral some corrections must b e made during the calculation. These

correction parameters are generated by comparing the needed terms and the

terms resulting from the hemicub e pro jections.

Let us examine the pro jection onto the top of the hemicub e. Using geo-

metric arguments and the notations of gure 10.5, the pro jected area of a

di erential patch dA is:

j

 

2

R cos   dA  cos   cos 

j j j i

T (dA )=H   dA   = H 

j ij j ij

2 4

r cos    r (cos  )

i i

(10:30)

since R =1=cos  .

i

Lo oking at the form factor formula, we notice that a weighted area is to

b e calculated, where the weight function comp ensates for the unexp ected

4

=(cos  ) term. Intro ducing the comp ensating function w valid on the top

i z

of the hemicub e, and expressing it by geometric considerations of gure 10.5

278 10. RADIOSITY METHOD

dA j 2 φ R cos φ j j dA j φ r cos i z φ i R 1 r x

dA i

Figure 10.5: Form factor calculation by hemicube algorithm

which supp oses an (x; y ; z ) co ordinate system attached to the dA , with axes

i

parallel with the sides of the hemicub e, we get:

4

(cos  ) 1

i

w (x; y )= = : (10:31)

z

2 2 2

  (x + y +1)

Similar considerations can lead to the calculation of the correction terms

of the pro jection on the side faces of the hemicub e:

If the side face is p erp endicular to the y axis, then:

z

w (x; z )= (10:32)

y

2 2 2

(x +z +1)

or if the side face is p erp endicular to the x axis:

z

w (y; z)= : (10:33)

x

2 2 2

(z +y +1)

The weighted area de ning the inner form factor is an area integral of a

weight function. If A has a pro jection onto the top of the hemicub e only,

j

then:

Z

4

cos 

i

d F = T (dA )  : (10:34)

i ij j



A j

10.1. FORM FACTOR CALCULATION 279

Instead of integrating over A , the same integral can also b e calculated

j

on the top of the hemicub e in an x; y ; z co ordinate system:

Z

1

top

d F = H (x; y )  dxdy (10:35)

i ij

ij

2 2 2

 (x + y +1)

T (A )

j

2 2 1=2

since cos  =1=(x +y +1) . Indicator H (x; y ) shows whether A is

i ij j

really visible through hemicub e p oint(x; y ; 1) from A or if it is obscured.

i

This integral is approximated by a nite sum having generated a P  P

raster mesh on the top of the hemicub e.

Z

top

d F = H (x; y )  w (x; y )dxdy 

i ij z

ij

T (A )

j

P=21 P=21

X X

1

H (X; Y )  w (X; Y ) : (10:36)

ij z

2

P

X=P=2 Y =P=2

The only unknown term here is H , which tells us whether or not surface

ij

j is visible through the raster cell called \pixel" (X; Y ). Thanks to the

research that has b een carried out into hidden surface problems there are

many e ective algorithms available which can also b e used here. An obvious

solution is the application of simple ray tracing. The center of dA and the

i

pixel de nes a ray whichmayintersect several other surfaces. If the closest

intersection is on the surface j , then H (X; Y ) is 1, otherwise it is 0.

ij

A faster solution is provided by the z-bu er metho d. Assume the color

of the surface A to b e j , the center of the camera to b e dA and the

j i

3D windowtobeagiven face of the hemicub e. Having run the z-bu er

algorithm, the pixels are set to the \color" of the surfaces visible in them.

Taking advantage of the ab ove de nition of color (color is the index of the

surface), each pixel will provide information as to which surface is visible in

it. We just have to add up the weights of those pixels which contain \color"

top

j in order to calculate the di erential form factor d F .

i

ij

The pro jections on the side faces can b e handled in exactly the same

way, except that the weight function has to b e selected di erently (w or

x

w dep ending on the actual side face). The form factors are calculated as a

y

sum of contributions of the top and side faces.

280 10. RADIOSITY METHOD

The complete algorithm, to calculate the F form factors using the z-

ij

bu er metho d, is:

for i =1 to N do for j =1 to N do F =0;

ij

for i =1 to N do

camera = center of A ;

i

for k =1 to 5 do // consider each face of the hemicube

window=kth face of the hemicub e;

for x =0 to P 1 do

for y =0 to P 1 do pixel [x; y ]= 0;

Z-BUFFER ALGORITHM (color of surface j is j )

for x =0 to P 1 do for y =0 to P 1 do

if (pixel [x; y ] > 0) then

2

F += w (x P=2;y P=2)=P ;

i;pixel[x;y ] k

endfor

endfor

endfor

2

In the ab ove algorithm the weight function w (x P=2;yP=2)=P must

k

be evaluated for those pixels through which other surfaces are visible and

must b e added to that form factor which corresp onds to the visible surface.

This is whyvalues of weight functions at pixel centers are called delta form

factors. Since the formula for weight functions contains manymultiplica-

tions and a division, its calculation in the inner lo op of the algorithm can

slowdown the form factor computation. However, these weight functions

are common to all hemicub es, thus they must b e calculated only once and

then stored in a table which can b e re-used whenever a value of the weight

function is needed.

2

Since the z-bu er algorithm has O (N  P )worst case complexity, the

computation of the form factors, emb edding 5N z-bu er steps, is obviously

2 2 2

O (N  P ), where N is the numb er of surface elements and P is the number

of pixels in the z-bu er. It is imp ortant to note that P can b e much less

than the resolution of the screen, since now the \pixels" are used only to

approximate an integral nitely.Typical values of P are 50 :::200.

Since the z-bu er step can b e supp orted by a hardware algorithm this

approach is quite e ectiveonworkstations supp orted by graphics accelera- tors.

10.1. FORM FACTOR CALCULATION 281

10.1.6 Cubic tetrahedral algorithm

The hemicub e algorithm replaced the hemisphere by a half cub e, allowing

the pro jection to b e carried out on ve planar rectangles, or side faces of

the cub e, instead of on a spherical surface. The numb er of planar surfaces

can b e decreased by using a cubic tetrahedron as an intermediate surface [BKP91], [BKP92].

z

y dA

x i

Figure 10.6: Cubic tetrahedral method

An appropriate cubic tetrahedron may b e constructed by slicing a cub e by

a plane that passes through three of its vertices, and placing the generated

pyramid on surface i (see gure 10.6). A convenient co ordinate system is

de ned with axes p erp endicular to the faces of the tetrahedron, and setting

scales to place the ap ex in p oint[1;1;1]. The base of the tetrahedron will

b e a triangle having vertices at [1; 1; 2], [1; 2; 1] and [2; 1; 1].

Consider the pro jection of a di erential surface dA on a side face p er-

j

p endicular to x axis, using the notations of gure 10.7. The pro jected area

is:

2

~

dA  cos  jR j

j j

0

dA =  : (10:37)

j

2

cos r

The correction term, to provide the internal variable in the form factor

integral, is:

cos   cos  dA  cos   cos 

i j j i

0 0

~

 = dA  w (R): (10:38) = dA

j j

2

2

~

  r

 jRj

282 10. RADIOSITY METHOD

tetrahedron face [1,1,1] dA j φ j x Θ φ i R

dA'j r

[0,0,0] surface

dA i

Figure 10.7: Projection to the cubic tetrahedron

~

Expressing the cosine of angles by a scalar pro duct with R p ointing to the

pro jected area:

~ ~

R  [1; 0; 0] R  [1; 1; 1]

cos  = ; cos  = : (10:39)

i

~ ~

jRj jR jj[1; 1; 1]j

~

Vector R can also b e de ned as the sum of the vector p ointing to the

ap ex of the pyramid ([1; 1; 1]) and a linear combination of side vectors of

pyramid face p erp endicular to x axis:

~

R =[1;1;1]+(1 u)[0; 1; 0]+(1v)[0; 0; 1]=[1;u;v]: (10:40)

This can b e turned to the previous equation rst, then to the formula of

the correction term:

u+v+1

p

w (u; v )= : (10:41)

2 2 2

  3(u +v +1)

Because of symmetry, the values of this weight function | that is the

delta form factors | need to b e computed and stored for only one-half

of any face when the delta form factor table is generated. It should b e

mentioned that cells lo cated along the base of the tetrahedron need sp ecial

10.2. SOLUTION OF THE LINEAR EQUATION 283

treatment, since they have triangular shap e. They can either b e simply

ignored, b ecause their delta form factors are usually very small, or they

can b e evaluated for the center of the triangle instead of the center of the

rectangular pixel.

10.2 Solution of the linear equation

The most obvious way to solve a linear equation is to apply the Gauss

elimination metho d [PFTV88]. Unfortunately it fails to solve the radiosity

3

equation for more complex mo dels e ectively, since it has O (N ) complex-

ity, and also it accumulates the round of errors of digital computers and

magni es these errors to the extent that the matrix is close to singular.

Fortunately another technique, called iteration, can overcome b oth prob-

lems. Examining the radiosity equation,

X

B = E + % B  F

i i i j ij

j

we will see that it gives the equality of the energy which has to b e radiated

due to emission and re ection (right side) and the energy really emitted

(left side). Supp ose that only estimates are available for B radiosities,

j

not exact values. These estimates can b e regarded as right side values,

thus having substituted them into the radiosity equation, b etter estimates

can b e exp ected on the left sides. If these estimates were exact | that is

they satis ed the radiosity equation |, then the iteration would not alter

the radiosityvalues. Thus, if this iteration converges, its limit will b e the

solution of the original radiosity equation.

In order to examine the metho d formally, the matrix version of the ra-

diosity equation is used to describ e a single step of the iteration:

B(m +1)= RB(m)+ E: (10:42)

A similar equation holds for the previous iteration to o. Subtracting the

two equations, and applying the same consideration recursively,we get:

m

B(m +1)B(m)= R(B(m)B(m1)) = R  (B(1) B(0)): (10:43)

The iteration converges if

m

lim kB(m +1) B(m)k =0; that is if lim kR k =0

m!1 m!1

284 10. RADIOSITY METHOD

for some matrix norm. Let us use the kRk norm de ned as the maximum

1

of absolute row sums

X

kRk = maxf F  % g (10:44)

1 ij i

i

j

and a vector norm that is compatible with it:

kbk = maxfjb jg: (10:45)

1 i

i

Denoting kRk by q ,wehave:

m m

kB(m +1)B(m)k = kR (B(1) B(0))kkRk kB(1) B(0)k =

m

q kB(1) B(0)k (10:46)

according to the prop erties of matrix norms. Since F represents the p ortion

ij

P

of the radiated energy of surface i, which actually reaches surface j , F

ij

j

is that p ortion which is radiated towards any other surface. This obviously

cannot exceed 1, and for physically correct mo dels, di use re ectance % < 1,

i

giving a norm that is de nitely less than 1. Consequently q<1, which

provides the convergence with, at least, the sp eed of a geometric series.

The complexity of the iteration solution dep ends on the op erations needed

for a single step and the numb er of iterations providing convergence. A

single step of the iteration requires the multiplication of an N dimensional

2

vector and an N  N dimensional matrix, which requires O (N ) op erations.

Concerning the numb er of necessary steps, we concluded that the sp eed

of the convergence is at least geometric by a factor q = kRk . The in nite

1

norm of R is close to b eing indep endent of the numb er of surface elements,

since as the numb er of surface elements increases, the value of form fac-

tors decreases, sustaining a constant sum of rows, representing that p ortion

of the energy radiated by surface i, which is gathered by other surfaces,

multipliedby the di use co ecient of surface i. Consequently, the number

of necessary iterations is indep endent of the numb er of surface elements,

2

) pro cess. making the iteration solution an O (N

10.2.1 Gauss{Seidel iteration

The convergence of the iteration can b e improved by the metho d of Gauss{

Seidel iteration. Its basic idea is to use the new iterated values immediately

10.3. PROGRESSIVE REFINEMENT 285

when they are available, and not to p ostp one their usage until the next

iteration step. Consider the calculation of B in the normal iteration:

i

B (m +1)= E +R  B (m)+R  B (m)+::: + R  B (m): (10:47)

i i i;1 1 i;2 2 i;N N

During the calculation of B (m + 1), values B (m +1); :::; B (m +1)

i 1 i1

have already b een calculated, so they can b e used instead of their previous

value, mo difying the iteration, thus:

B (m +1)= E +R  B (m +1)+::: + R  B (m + 1)+

i i i;1 1 i;i1 i1

R  B (m)+ ::: + R  B (m) (10:48)

i;i+1 i+1 i;N N

(recall that R = 0 in the radiosity equation).

i;i

A trick, called successive relaxation, can further improve the sp eed of

convergence. Supp ose that during the mth step of the iteration the radiosity

vector B(m +1)was computed. The di erence from the previous estimate

is:

B = B(m +1)B(m) (10:49)

showing the magnitude of di erence, as well as the direction of the im-

provementin N dimensional space. According to practical exp erience, the

direction is quite accurate, but the magnitude is underestimated, requiring

the correction by a relaxation factor ! :



B (m +1)= B(m)+! B: (10:50)

The determination of ! is a crucial problem. If it is to o small, the con-

vergence will b e slow; if it is to o great, the system will b e unstable and

divergent. For many sp ecial matrices, the optimal relaxation factors have

already b een determined, but concerning our radiosity matrix, only practi-

cal exp eriences can b e relied on. Cohen [CGIB86] suggests that relaxation

factor 1.1 is usually satisfactory.

10.3 Progressive re nement

The previously discussed radiosity metho d determined the form factor ma-

trix rst, then solved the linear equation by iteration. Both steps require

2

O (N ) time and space, restricting the use of this algorithm in commercial

286 10. RADIOSITY METHOD

applications. Most of the form factors, however, havevery little e ect on

the nal image, thus, if they were taken to b e 0, a great amount of time

and space could b e gained for the price of a negligible deterioration of the

image quality. A criterion for selecting unimp ortant form factors can b e

established by the careful analysis of the iteration solution of the radiosity

equation:

X X

B (m +1)= E +% B (m)F = E + (B due to B (m))

i i i j ij i i j

j j

(B due to B )=% B F : (10:51)

i j i j ij

If B is small, then the whole column i of R will not maketoomuch

j

di erence, thus it is not worth computing and storing its elements. This

seems acceptable, but how can we decide which radiosities will b e small, or

which part of matrix R should b e calculated, b efore starting the iteration?

We certainly cannot make the decision b efore knowing something ab out the

radiosities, but we can de nitely do it during the iteration by calculating a

column of the form factor matrix only when it turns out that it is needed,

since the corresp onding surface has signi cant radiosity.

Supp ose wehave an estimate B allowing for the calculation of the contri-

j

bution of this surface to all the others, and for determining a b etter estimate

for other surfaces by adding this new contribution to their estimated value.

If an estimate B increases byB , due to the contribution of other surfaces

j j

to this radiosity, other surface radiosities should also b e corrected accord-

ing to the new contribution of B , resulting in an iterative and progressive

j

re nement of surface radiosities:

new old

B = B + %  (B )  F : (10:52)

i j ij

i i

Note that, in contrast to the previous radiosity metho d when wewere

interested in how a surface gathers energy from other surfaces, now the di-

rection of the light is followed fo cusing on how surfaces sho ot light to other

surfaces. A radiosity increment of a surface, which has not yet b een used

to up date other surface radiosities, is called unshot radiosity. In fact, in

equation 10.52, the radiosity of other surfaces should b e corrected according

to the unshot radiosity of surface j . It seems reasonable to select for sho ot-

ing that surface which has the highest unshot radiosity.Having selected a

10.3. PROGRESSIVE REFINEMENT 287

surface, the corresp onding column of the form factor matrix should b e calcu-

lated. We can do that on every o ccasion when a surface is selected to sho ot

its radiosity. This reduces the burden of the storage of the N  N matrix

elements to only a single column containing N elements, but necessitates

the recalculation of the form factors. Another alternative is to store the al-

ready generated columns, allowing for reduction of the storage requirements

by omitting those columns whose surfaces are never selected, due to their

low radiosity. Let us realize that equation 10.52 requires F ;F ;:::;F ,

1j 2j Nj

that is a single column of the form factor matrix, to calculate the radiosity

up dates due to B . The hemicub e metho d, however, supp orts \parallel"

j

generation of the rows of the form factor matrix, not of the columns. For

di erentrows, di erent hemicub es have to b e built around the surfaces.

Fortunately, the recipro city relationship can b e applied to evaluate a single

column of the matrix based on a single hemicub e:

A

j

F  A = F  A =) F = F  (i =1; :::; N ) (10:53)

ji j ij i ij ji

A

i

These considerations have formulated an iterative algorithm, called pro-

gressive re nement. The algorithm starts by initializing the total (B )

i

and unshot (U ) radiosities of the surfaces to their emission, and stops if the

i

unshot radiosity is less than an acceptable threshold for all the surfaces:

for j =1 to N do B = E ; U = E

j j j j

do

j = Index of the surface of maximum U ;

j

Calculate F , F ,..., F by a single hemicub e;

j 1 j 2 jN

for i =1 to N do

B = %  U  F  A =A ;

i i j ji j i

U += B ;

i i

B += B ;

i i

endfor

U =0;

j

error = maxfU ;U ; :::; U g;

1 2 N

while er r or > thr eshol d;

This algorithm is always convergent, since the total amount of unshot

energy decreases in each step by an attenuation factor of less than 1. This

288 10. RADIOSITY METHOD

statement can b e proven by examining the total unshot radiosities during

the iteration, supp osing that U was maximal in step m, and using the

j

notation q = kRk again:

1

N N N N N

X X X X X

U (m +1) = U (m)+U  % F =( U (m)) U + U %  F 

i i j i ij i j j i ij

i i i i

i6=j

N N N

X X X

1 q



 ( U (m)) (1 q )  U  (1 )  U (m)= q  U (m) (10:54)

i j i i

N

i i i

P P

N N

since q = max f %  F g < 1 and U  U =N , b ecause it is the

i i ij j i

i i

maximal value among U -s.

i



Note that, in contrast to the normal iteration, the attenuation factor q

de ning the sp eed of convergence now do es dep end on N , slowing down the

convergence by approximately N times, and making the numb er of necessary

iterations prop ortional to N . A single iteration contains a single lo op of

2

length N in progressive re nement, resulting in O (N )overall complexity,

taking into account the exp ected numb er of iterations as well. Interestingly,

2

progressive re nement do es not decrease the O (N ) time complexity, but in

its simpler form when the form factor matrix is not stored, it can achieve

2

O (N ) space complexity instead of the O (N ) b ehavior obtained by the

original metho d.

10.3.1 Application of vertex-surface form factors

In the traditional radiosity and the discussed progressive re nement meth-

o ds, the radiosity distributions of the elemental surfaces were assumed to b e

constant, as were the normal vectors. This is obviously far from accurate,

and the e ects need to b e reduced by a bilinear interp olation of Gouraud

shading at the last step of the image generation. In progressive re nement,

however, the linear radiosity approximation can b e intro duced earlier, even

during the phase of the calculation of radiosities. Besides, the real surface

normals in the vertices of the approximating p olygons can b e used resulting

in a more accurate computation.

This metho d is based on the examination of energy transfer b etween a

di erential area (dA ) around a vertex of a surface and another nite surface

i

(A ), and concentrates on the radiosityofvertices of p olygons instead of j

10.3. PROGRESSIVE REFINEMENT 289

the radiosities of the p olygons themselves. The normal of dA is assumed

i

to b e equal to the normal of the real surface in this p oint. The p ortion

of the energy landing on the nite surface and the energy radiated by the

di erential surface element is called the vertex-surface form factor (or

vertex-patch form factor).

The vertex-surface form factor, based on equation 10.6, is:

Z Z Z

1 dA  cos   dA  cos  cos   cos 

i i j j i j

v

F =  H  = H  dA :

ij ij j

ij

2 2

dA   r   r

i

dA A A

i j j

(10:55)

This expression can either b e evaluated byany discussed metho d or by

simply ring several rays from dA towards the centers of the patches gen-

i

erated by the sub division of surface elementA. Eachray results in a

j

visibility factor of either 0 or 1, and an area-weighted summation has to b e

carried out for those patches whichhave visibility 1 asso ciated with them.

Supp ose that in progressive re nement total and unshot radiosity esti-

mates are available for all vertices of surface elements. Unshot surface ra-

diosities can b e approximated as the average of their unshot vertex radiosi-

ties. Having selected the surface element with the highest unshot radiosity

(U ), and having also determined the vertex-surface form factors from all

j

the vertices to the selected surface (note that this is the reverse direction),

the new contributions to the total and unshot radiosities of vertices are:

v v

B = %  U  F : (10:56)

i j

i ij

This has mo di ed the total and unshot radiosities of the vertices. Thus,

estimating the surface radiosities, the last step can b e rep eated until con-

vergence, when the unshot radiosities of vertices b ecome negligible. The

radiosity of the vertices can b e directly turned to intensity and color in-

formation, enabling Gouraud's algorithm to complete the shading for the

internal pixels of the p olygons.

10.3.2 Probabilistic progressive re nement

In probabilistic form factor computation, rays were red from surfaces to

determine which other surfaces can absorb their radiosity. In progressive

re nement, on the other hand, the radiosity is shot prop ortionally to the

290 10. RADIOSITY METHOD

precomputed form factors. These approaches can b e merged in a metho d

which randomly sho ots photons carrying a given p ortion of energy.Asin

progressive re nement, the unshot and total radiosities are initialized to the

emission of the surfaces. At each step of the iteration a p oint is selected at

random on the surface which has the highest unshot radiosity, a direction

is generated according to the directional distribution of the radiation (co-

sine distribution), and a given p ortion, say1=nth, of the unshot energy is

delivered to that surface which the photon encounters rst on its way.

The program of this algorithm is then:

for j =1 to N do B = U = E

j j j

do

j = Index of the surface of maximum U

j

~p = a random p oint on surface j by uniform distribution

~

d = a random direction from p~ by cosine distribution

~

if ray (~p; d) hits surface i rst then

U += %  U =n;

i i j

B += %  U =n;

i i j

endif

U -= U =n;

j j

error = maxfU ;U ; :::; U g;

1 2 N

while er r or > thr eshol d;

This is p ossibly the simplest algorithm for radiosity calculation. Since it

do es not rely on form factors, shading mo dels other than di use re ection

can also b e incorp orated.

10.4 Extensions to non-di use

environments

The traditional radiosity metho ds discussed so far consider only di use re-

ections, having made it p ossible to ignore directional variation of the radia-

tion of surfaces, since di use re ection generates the same radiantintensity

in all directions. To extend the basic metho d taking into account more

10.4. EXTENSIONS TO NON-DIFFUSE ENVIRONMENTS 291

terms in the general shading equation, directional dep endence has to b e

built into the mo del.

The most obvious approach is to place a partitioned on each ele-

mental surface, and to calculate and store the intensity in each solid angle

derived from the partition [ICG86 ]. This partitioning also transforms the

integrals of the shading equations to nite sums, and limits the accuracy

of the direction of the incoming light b eams. Deriving a shading equa-

tion for each surface element and elemental solid angle, a linear equation

is established, where the unknown variables are the radiantintensities of

the surfaces in various solid angles. This linear equation can b e solved by

similar techniques to those discussed so far. The greatest disadvantage of

this approach is that it increases the numb er of equations and the unknown

variables by a factor of the numb er of partitioning solid angles, making the

metho d prohibitively exp ensive.

More promising is the combination of the radiosity metho d with ray trac-

ing, since the resp ective strong and weak p oints of the two metho ds tend

to complement each other.

10.4.1 Combination of radiosity and ray tracing

In its simplest approach, the nal, view-dep endent step of the radiosity

metho d involving Gouraud shading and usually z-bu ering can b e replaced

by a recursiveray tracing algorithm, where the di use comp onent is deter-

mined by the surface radiosities, instead of taking into consideration the

abstract lightsources, while the surface radiosities are calculated by the

metho ds wehave discussed, ignoring all non-di use phenomena. The result

is much b etter than the outcome of a simple recursiveray tracing, since the

shadows lose their sharpness. The metho d still neglects some typ es of cou-

pling, since, for example, it cannot consider the di use re ection of a light

b eam coherently re ected or refracted onto other surfaces. In gure 10.8,

for example, the vase should have b een illuminated by the light coherently

re ected o the mirror, but the algorithm in question makes it dark, since

the radiosity metho d ignores non-di use comp onents. A p ossible solution

to this problem is the intro duction and usage of extended form factors

[SP89 ].

A simpli ed shading mo del is used which breaks down the energy radiated

by a surface into di use and coherently re ected or refracted comp onents.

292 10. RADIOSITY METHOD

lightsource mirror

object

eye

Figure 10.8: Coherent-di use coupling: The vase should have been il luminated

by the light re ected o the mirror



An extended form factor F ,by de nition represents that p ortion of the

ij

energy radiated di usely by surface i which actually reaches surface j ei-

ther by direct transmission or by single or multiple coherent re ections or

refractions. The use of extended form factors allows for the calculation of

the di use radiance of patches which takes into account not only di use but

also coherentinterre ections. Supp ose di use radiance B of surface i needs

i

to b e calculated. Di use radiance B is determined by the di use radiation

i

of other surfaces which reaches surface i and by those light comp onents

which are coherently re ected or refracted onto surface i. These coherent

comp onents can b e broken down into di use radiances and emissions which

are later coherently re ected or refracted several times, thus similar expres-

sion holds for the di use radiance in the improved mo del as for the original,

only the normal form factors must b e replaced by the extended ones. The

extended radiosity equation de ning the di use radiance of the surfaces in

a non-di use environment is then:

Z



B  dA = E  dA + %  B  F  dA : (10:57)

i i i i i j j

ji

Recursiveray tracing can b e used to calculate the extended form factors.

For each pixel of the hemicub e a ray is generated which is traced backward

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 293

nding those surfaces which can b e visited along this ray.For each surface

found that p ortion of its di usely radiated energy which reaches the previous

surface along the ray should b e computed | this is a di erential form factor

| then the attenuation of subsequent coherent re ections and refractions

must b e taken into consideration bymultiplying the di erential form factor

by the pro duct of the refractive and re ective co ecients of the surfaces

visited by the raybetween the di use source and surface i. Adding these

p ortions of p ossible contribution for each pixel of the hemicub e also taking

the hemicub e weighting function into account, the extended form factors can

b e generated. Having calculated the extended form factors, the radiosity

equation can b e solved by the metho d discussed, resulting in the di use

radiosities of the surfaces.

Exp ensiveray-tracing can b e avoided and normal form factors can b e

worked with if only single, ideal, mirror-like coherent re ections are allowed,

b ecause this case can b e supp orted by mirroring every single surface onto

the re ective surfaces. We can treat these re ective surfaces as windows

onto a \mirror world", and the normal form factor b etween the mirrored

surface and another surface will b e resp onsible for representing that part of

energy transfer whichwould b e represented by the di erence of the extended

and normal form factors [WCG87 ].

If the di use radiosities of the surfaces are generated, then in the second,

view-dep endent phase another recursiveray-tracing algorithm can b e ap-

plied to generate the picture. Whenever a di use intensity is needed this

second pass ray-tracing will use the radiosities computed in the rst pass.

In contrast to the naive combination of ray-tracing and radiosity, the dif-

fuse radiosities are now correct, since the rst pass to ok not only the di use

interre ections but also the coherentinterre ections and refractions into

consideration.

10.5 Higher order radiosity approximation

The original radiosity metho d is based on nite element techniques. In

other words, the radiosity distribution is searched in a piecewise constant

function form, reducing the original problem to the calculation of the values of the steps.

294 10. RADIOSITY METHOD

The idea of piecewise constant approximation is theoretically simple and

easy to accomplish, but an accurate solution would require a large number

of steps, making the solution of the linear equation dicult. Besides, the

constant approximation can intro duce unexp ected artifacts in the picture

even if it is softened by Gouraud shading.

This section addresses this problem by applying a variational metho d for

the solution of the integral equation [SK93].

The variational solution consists of the following steps [Mih70]:

1. It establishes a functional which is extreme for a function (radiosity

distribution) if and only if the function satis es the original integral

equation (the basic radiosity equation).

2. It generates the extreme solution of the functional by Ritz's metho d,

that is, it approximates the function to b e found by a function series,

where the co ecients are unknown parameters, and the extremum is

calculated by making the partial derivatives of the functional (which

is a function of the unknown co ecients) equal to zero. This results

in a linear equation which is solved for the co ecients de ning the

radiosity distribution function.

Note the similarities b etween the second step and the original radiosity

metho d. The prop osed variational metho d can, in fact, b e regarded as a

generalization of the nite element metho d, and, as we shall see, it contains

that metho d if the basis functions of the function series are selected as

piecewise constant functions b eing equal to zero except for a small p ortion

of the surfaces. Nevertheless, we are not restricted to these basis functions,

and can select other function bases, which can approximate the radiosity

distribution more accurately and by fewer basis functions, resulting in a

b etter solution and requiring the calculation of a signi cantly smaller linear

equation.

Let the di use co ecientbe %(p)atpointpand the visibility indicator

0 0

be H (p; p ). Using the notations of gure 10.9, and between p oints p and p

denoting the radiosity and emission at p oint p by B (p) and E (p) resp ec-

tively, the basic radiosity equation is:

Z

0 0 0

B (p)  dA = E (p)  dA + %(p)  B (p ) f (p; p ) dA  dA (10:58) A

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 295

dA p φ(p) r φ (p')

A

p' dA'

Figure 10.9: Geometry of the radiosity calculation

0

where f (p; p )isthep oint-to-p oint form factor:

0

cos (p)  cos (p )

0 0

f (p; p )=H(p; p ) : (10:59)

2

r 

Dividing b oth sides by dA, the radiosity equation is then:

Z

0 0 0

B(p) f(p; p ) dA : (10:60) B (p)= E(p)+%(p)

A

Let us de ne a linear op erator L:

Z

0 0 0

B(p) f(p; p ) dA : (10:61) LB (p)=B(p)%(p)

A

Then the radiosity equation can also b e written as follows:

LB (p)=E(p): (10:62)

The solution of the radiosity problem means to nd a function B satisfying

this equation. The domain of p ossible functions can obviously b e restricted

to functions whose has nite integration over surface A. This func-

tion space is usually called L (A) space where the scalar pro duct is de ned

2

as:

Z

hu; v i = u(p)  v (p) dA: (10:63) A

296 10. RADIOSITY METHOD

If L were a symmetric and p ositive op erator, that is, for any u; v in L (A),

2

hLu; v i = hu; Lv i (10:64)

were an identity and

hLu; ui0 ^ hLu; ui =0 if and only if u =0; (10:65)

then according to the minimal theorem of quadratic functionals [Ode76] the

solution of equation 10.62 could also b e found as the stationary p oint of the

following functional:

hLB; Bi2hE; Bi + hE; Ei: (10:66)

Note that hE; Ei makes no di erence in the stationary p oint, since it do es

not dep end on B , but it simpli es the resulting formula.

To prove that if and only if some B satis es

0

LB = E (10:67)

0

for a symmetric and p ositive op erator L, then B is extreme for the func-

0

tional of equation 10.66, a sequence of identity relations based on the as-

sumption that L is p ositive and symmetric can b e used:

hLB; Bi2hE; Bi + hE; Ei = hLB; Bi2hLB ;Bi + hE; Ei =

0

hLB; BihLB ;BihB ;LBi+hE; Ei =

0 0

hLB; BihLB ;BihLB; B i + hLB ;B ihLB ;B i + hE; Ei =

0 0 0 0 0 0

hL(B B ); (B B )ihLB ;B i + hE; Ei: (10:68)

0 0 0 0

Since only the term hL(B B ); (B B )i dep ends on B and this term

0 0

is minimal if and only if B B is zero due to the assumption that L is

0

p ositive, therefore the functional is really extreme for that B which satis es

0

equation 10.62.

Unfortunately L is not symmetric in its original form (equation 10.61)

due to the asymmetry of the radiosity equation which dep ends on %(p) but

0

not on %(p ). One p ossible approach to this problem is the sub division of

surfaces into nite patches having constant di use co ecients, and working

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 297

with multi-variate functionals, but this results in a signi cant computational

overhead.

Now another solution is prop osed that eliminates the asymmetry by cal-

q

culating B (p) indirectly through the generation of B (p)= %(p) . In order to

q

do this, b oth sides of the radiosity equation are divided by %(p):

Z

q 0 q

E (p) B (p) B (p )

0 0

0

q q q

= %(p) %(p ) f (p; p ) dA : (10:69)

0

%(p) %(p) %(p )

A

  0

Let us de ne B (p), E (p) and g (p; p )by the following formulae:

q

B(p) E(p)

  0 0

0

q q

B (p)= %(p)%(p ): ; E (p)= ; g(p; p )= f(p; p )

%(p) %(p)

(10:70)

Using these de nitions, we get the following form of the original radiosity

equation:

Z

 0 0 0  

B (p) g(p; p ) dA : (10:71) E (p)=B (p)

A

0 0

Since g (p; p )= g(p;p), this integral equation is de ned by a symmetric



linear op erator L :

Z

 0 0 0   

B (p) g(p; p ) dA : (10:72) L B (p)=B (p)

A



As can easily b e proven, op erator L is not only symmetric but also

p ositive taking into account that for physically correct mo dels:

Z Z Z

0 0 0

B (p) dA: (10:73) B (p )g (p; p ) dA dA 

A A A

This means that the solution of the mo di ed radiosity equation is equiv-

alent to nding the stationary p oint of the following functional:

       

I (B )=hL B ;B i2hE ;B i + hE ;E i =

Z Z Z

2

    0 0 0

(E (p) B (p)) dA B (p) B (p ) g (p; p ) dA dA : (10:74)

A A A

This extreme prop erty of functional I can also b e proven by generating

the functional's rst variation and making it equal to zero:



@I (B + B)

0=I = j : (10:75)

=0 @

298 10. RADIOSITY METHOD

Using elementary derivation rules and taking into account the following

symmetry relation:

Z Z Z Z

 0 0 0  0 0 0

B (p) B (p ) g(p; p ) dAdA = B (p) B (p ) g(p; p ) dAdA

A A A A

(10:76)

the formula of the rst variation is transformed to:

Z Z

   0 0 0

0=I = [E (p) B (p)+ B (p )g(p; p ) dA ]   B dA: (10:77)

A A

The term closed in brackets should b e zero to make the expression zero for

any B variation. That is exactly the original radiosity equation, hence

nding the stationary p oint of functional I is really equivalent to solving

integral equation 10.71.



In order to nd the extremum of functional I (B ), Ritz's metho d is used.



Assume that the unknown function B is approximated by a function series:

n

X



B (p)  a  b (p) (10:78)

k k

k =1

where (b ;b ; :::; b ) form a complete function system (that is, any piecewise

1 2 n

continuous function can b e approximated by their linear combination), and

(a ;a ; :::; a ) are unknown co ecients. This assumption makes functional

1 2 n



I (B )ann-variate function I (a ; :::; a ), which is extreme if all the partial

1 n

derivatives are zero. Having made every @ I =@ a equal to zero, a linear

k

equation system can b e derived for the unknown a -s (k = f1; 2; :::; ng):

k

Z Z Z Z

n

X

 0 0 0

E (p)b (p)dA: b (p)b (p )g (p; p ) dAdA ]= b (p)b (p)dA a [

k k i i k i

i=0

A A A A

(10:79)

This general formula provides a linear equation for any kind of complete

function system b ; :::; b ,thus it can b e regarded as a basis of many dif-

1 n

ferent radiosity approximation techniques, b ecause the di erent selection of

basis functions, b , results in di erent metho ds of determining the radiosity

i distribution.

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 299

Three typ es of function bases are discussed:

 piecewise constant functions which lead to the traditional metho d,

proving that the original approach is a sp ecial case of this general

framework,

 piecewise linear functions which, as we shall see, are not more dicult

than the piecewise constant approximations, but they can provide

more accurate solutions. It is, in fact, a re ned version of the metho d

of \vertex-surface form factors",

 harmonic (cosine) functions where the basis functions are not of nite

elementtyp e b ecause they can approximate the radiosity distribution

everywhere not just in a restricted part of the domain, and thus fall

into the category of global element metho ds.

piecewise constant

piecewise linear

harmonic (cosine)

Figure 10.10: One-dimensional analogy of proposedbasis functions

10.5.1 Piecewise constant radiosity approximation

Following a nite element approach, an appropriate set of b functions can

k

b e de ned having broken down the surface into A ,A ,...,A surface

1 2 n

elements:

8

1ifp is on A

<

k

b (p)= (10:80)

k

: 0 otherwise

300 10. RADIOSITY METHOD

If the emission E and the di use co ecient % are assumed to b e con-

stant on the elemental surface A and equal to E and % resp ectively,

k k k

equation 10.79 will have the following form:

Z Z

n

X

E

k

0 0

a A a [ A : (10:81) g (p; p ) dAdA ]=

p

k k i k

%

k

i=0

A A

i

k

According to the de nition of basis function b , the radiosity of patch k is:

k

p p



B = B % = a % : (10:82)

k k k k

k

0

Substituting this into equation 10.81 and using the de nition of g (p; p )in

equation 10.70, we get:

Z Z

n

X

0 0

B [ f (p; p ) dAdA ]=E A : (10:83) B A %

i k k k k k

i=0

A A

i

k

Let us intro duce the patch-to-patch form factor as follows:

Z Z

1

0 0

F = f (p; p ) dAdA : (10:84)

ki

A

k

A A

i

k

Note that this is the usual de nition taking into account the interpretation

0

of f (p; p ) in equation 10.59.

Dividing b oth sides byA , the linear equation is then:

k

n

X

B % B F = E : (10:85)

k k i ki k

i=0

This is exactly the well known linear equation of original radiosity metho d

(equation 10.10). Now let us b egin to discuss how to de ne and use other,

more e ective function bases.

10.5.2 Linear nite element techniques

Let us decomp ose the surface into planar triangles and assume that the

radiosityvariation is linear on these triangles. Thus, eachvertex i of the

triangle mesh will corresp ond to a \tent shap ed" basis function b that is 1 i

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 301

at this vertex and linearly decreases to 0 on the triangles incident to this

vertex.

Placing the center of the co ordinate system into vertex i, the p osition

vector of p oints on an incident triangle can b e expressed by a linear combi-

~

nation of the edge vectors ~a; b:

~

~p = ~a + b (10:86)

with ;  0 ^ +  1.

1

b i (p) basis function

Figure 10.11: Linear basis function in three dimensions

Thus, the surface integral of some function F on a triangle can b e written

as follows:

1

1

Z Z Z

~

F (~p)dA = F ( ; )j~a  bjd d =

=0

A =0

1

1

Z Z

2A F ( ; ) d d : (10:87)

=0

=0

If F ( ; ) is a p olynomial function, then its surface integration can b e de-

termined in closed form by this formula.

302 10. RADIOSITY METHOD

The basis function which is linearly decreasing on the triangles can b e

conveniently expressed by ; co ordinates:

b ( ; )= 1 ;

k

0

b ( ; )= ;

k

(10:88)

00

b ( ; )= ;

k

0 00

b =0 if i 6= k; k ;k

i

0 00

where k , k and k are the three vertices of the triangle.

Let us consider the general equation (equation 10.79) de ning the weights

of basis functions; that is the radiosities at triangle vertices for linear nite

elements. Although its integrals can b e evaluated directly,itisworth ex-

amining whether further simpli cation is p ossible. Equation 10.79 can also

b e written as follows:

Z Z

n

X

0 0 0 

b (p )g (p; p ) dA gE (p)]  b (p) dA =0 (10:89) a fb (p) [

i k i i

i=0

A A

The term enclosed in brackets is a piecewise linear expression according to



our assumption if E is also linear. The integration of the pro duct of this

expression and any linear basis function is zero. That is p ossible if the term

in brackets is constantly zero, thus an equivalent system of linear equations

can b e derived by requiring the closed term to b e zero in eachvertex k (this

implies that the function will b e zero everywhere b ecause of linearity):

Z

n

X

0 0 0 

a a b (p )g (p ;p ) dA = E ; k = f1; 2; :::ng (10:90)

k i i k

k

i=0

A

As in the case of piecewise constant approximation, the di use co ecient

%(p) is assumed to b e equal to % at vertex k , and using the de nitions of

k

the normalized radiosities we can conclude that:

B E

k k

 

a = B = ; E = : (10:91)

p p

k

k k

% %

k k

Substituting this into equation 10.90 and taking into account that b is zero

i

outside A ,we get:

i

s

Z

n

0

X

%(p )

0 0 0

dA ]=E : (10:92) B % B [ b (p )f (p ;p )

k k k i i k

%

i

i=0

A i

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 303

Let us intro duce the vertex-patch form factor P :

ki

s

Z

0

%(p )

0 0 0

dA : (10:93) P = b (p )f (p ;p )

ki i k

%

i

A

i

If the di use co ecient can b e assumed to b e (approximately) constanton

the triangles adjacenttovertex i, then:

Z

0 0 0

P  b (p )f (p ;p ) dA : (10:94)

ki i k

A

i

The linear equation of the vertex radiosities is then:

n

X

B % B P = E : (10:95)

k k i ki k

i=0

This is almost the same as the linear equation describing the piecewise

constant approximation (equation 10.85), except that:

 Unknown parameters B ; :::; B representnowvertex radiosities rather

1 k

than patch radiosities. According to Euler's law, the number of ver-

tices of a triangular faced p olyhedron is half of the numb er of its faces

plus two. Thus the size of the linear equation is almost the same as

for the numb er of quadrilaterals used in the original metho d.

 There is no need for double integration and thus the linear approxi-

mation requires a simpler numerical integration to calculate the form

factors than constant approximation.

The vertex-patch form factor can b e evaluated by the techniques devel-

op ed for patch-to-patch form factors taking account also the linear variation

due to b . This integration can b e avoided, however, if linear approxima-

i

0

tion of f (p ;p ) is acceptable. One wayofachieving this is to select the

k

sub division criterion of surfaces into triangles accordingly.

A linear approximation can b e based on p oint-to-p oint form factors b e-

0

tween vertex k and the vertices of triangle A . Let the f (p ;p)values of

k

the p ossible combinations of p oint p and the vertices b e F ;F ;F resp ec-

k 1 2 3

tively. A linear interp olation of the p oint-to-p oint form factor b etween p

k

0 0 0 0 0

~

and p = ~a + b is:

0 0 0 0 0

f (p ;p )= F + F +(1 )F : (10:96)

k 1 2 3

304 10. RADIOSITY METHOD

Using this assumption the surface integral de ning P can b e expressed

ki

in closed form.

10.5.3 Global element approach | harmonic

functions

In contrast to previous cases, the application of harmonic functions do es

not require the sub division of surfaces into planar p olygons, but deals with

the original geometry. This prop erty makes it esp ecially useful when the

view-dep endent rendering phase uses ray-tracing.

Supp ose surface A is de ned parametrically by a p osition vector function,

~r (u; v ), where parameters u and v are in the range of [0; 1].

Let a representative of the basis functions b e:

i j

b = cos(i u)  cos(jv)=C C (10:97)

ij

u v

i

(C substitutes cos(i u) for notational simplicity). Note that the basis

u

functions havetwo indices, hence the sums should also b e replaced by double

summation in equation 10.79. Examining the basis functions carefully,we

can see that the goal is the calculation of the Fourier series of the radiosity

distribution.

In contrast to the nite element metho d, the basis functions are now non-

zero almost everywhere in the domain, so they can approximate the radiosity

distribution in a wider range. For that reason, approaches applying this kind

of basis function are called global element metho ds.

In the radiosity metho d the most time consuming step is the evalua-

tion of the integrals app earing as co ecients of the linear equation sys-

tem (equation 10.79). By the application of cosine functions, however, the

computational time can b e reduced signi cantly, b ecause of the orthogonal

prop erties of the trigonometric functions, and also by taking advantage of

e ective algorithms, suchasFast Fourier Transform (FFT).

In order to illustrate the idea, the calculation of

Z



E (p)b (p) dA

kl

A

 

for each k; l is discussed. Since E (p)=E(~r(u; v )), it can b e regarded

2

as a function de ned over the square [0; 1] . Using the equalities of surface

10.5. HIGHER ORDER RADIOSITY APPROXIMATION 305

integrals, and intro ducing the notation J (u; v )= j@~r=@ u  @~r=@ v j for surface

element magni cation, we get:

1 1

Z Z Z

 

E (~r (u; v ))b (u; v )J (u; v ) dudv : (10:98) E (p)b (p) dA =

kl kl

0 0

A



Let us mirror the function E (~r )  J (u; v )onto co ordinate system axes

2

u and v , and rep eat the resulting function having its domain in [1; 1]

in nitely in b oth directions with p erio d 2. Due to mirroring and p erio dic

^

rep etition, the nal function E (u; v ) will b e even and p erio dic with p erio d

2 in b oth directions. According to the theory of the Fourier series, the

function can b e approximated by the following sum:

m m

X X

i j

^

E (u; v )  E C C : (10:99)

ij

u v

i=0 j =0

All the Fourier co ecients E can b e calculated by a single, two-dimensional

ij

FFT. (A D -dimensional FFT of N samples can b e computed by taking

D1

DN numb er of one-dimensional FFTs [Nus82] [PFTV88].)



^

Since E (u; v )=E (~r)J(u; v )if0u; v  1, this Fourier series and the

de nition of the basis functions can b e applied to equation 10.98, resulting

in:

1 1

Z Z Z

m m

X X

 i j

E (p)b (p) dA = E C C  b (u; v ) dudv =

kl ij kl

u v

i=0 j =0

u=0 v =0

A

8

E if k = 0 and l =0

0;0

>

>

>

>

>

>

>

>

>

1 1

> E =2 if k = 0 and l 6=0

Z Z

0;l

m m

<

X X

i k j l

E C C du C C dv = (10:100)

ij

u u v v

>

>

i=0 j =0 >

E =2 if k 6= 0 and l =0

0 0 >

k;0

>

>

>

>

>

>

:

E =4 if k 6= 0 and l 6=0

k;l

Consequently, the integral can b e calculated in closed form, having re-

placed the original function byFourier series. Similar metho ds can b e used

to evaluate the other integrals. In order to compute

Z

b (p)b (p)dA

ij kl

A

J (u; v )must b e Fast Fourier Transformed.

306 10. RADIOSITY METHOD

To calculate

Z Z

0 0 0

b (p)b (p)g (p; p ) dAdA

k

i

A A

the Fourier transform of

0 0 0 0 0

g (p(u; v );p (u ;v ))  J (u; v )J (u ;v )

is needed. Unfortunately the latter requires a 4D FFT whichinvolves

many op erations. Nevertheless, this transform can b e realized bytwotwo-

0

dimensional FFTs if g (p; p ) can b e assumed to b e nearly indep endentof

0 0

either p or p , or it can b e approximated by a pro duct form of p and p

indep endent functions.

Finally, it should b e mentioned that other global function bases can

also b e useful. For example, Chebyshev p olynomials are e ective in ap-

proximation, and similar techniques to FFT can b e develop ed for their computation.