computer graphics - week 11feiner/courses/csw4160/slides/s99-11.pdf · assignment 4 you should have...

29
Computer Graphics - Week 11 Computer Graphics - Week 11 Bengt-Olaf Schneider Bengt-Olaf Schneider IBM T.J. Watson Research Center IBM T.J. Watson Research Center © Bengt-Olaf Schneider, 1999 Computer Graphics – Week 11 Questions about Last Week ? Questions about Last Week ?

Upload: others

Post on 21-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

Computer Graphics - Week 11Computer Graphics - Week 11

Bengt-Olaf SchneiderBengt-Olaf SchneiderIBM T.J. Watson Research CenterIBM T.J. Watson Research Center

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Questions about Last Week ?Questions about Last Week ?

Page 2: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Assignment 4Assignment 4

You should have started by nowThere will not be an extension on the deadline because of department deadlines.

Updated assignment text on the web pageClarification of how viewing conditions are specified

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Overview of Week 11Overview of Week 11

Global Illumination (Part 2)RadiosityAcceleration strategiesTwo-pass rendering

Page 3: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Ray Tracing: ReviewRay Tracing: Review

Ray tracing follows rays from the eye into the sceneAt every intersection light rays are cast towards the light sourcesSecondary rays along direction of ideal reflection and refractionWorks best for highly specular objects, i.e.where itensity distribution is narrowly distributed around ideal reflection and refractionUses ambient lighting to model other effects

Difficultities modeling diffuse reflection and dispersive refractionIn general, problems exist for all effects where indirect light from several directions contributes to a ray's intensity

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity: Motivation (1)Radiosity: Motivation (1)

Scene geometry (sculpture)No light can be traced from behind the sculpture to the viewerColored surfaces facing backward, white faces towards the viewer

(C) Cornell University (C) Cornell University

Page 4: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity: Motivation (2)Radiosity: Motivation (2)

(C) Cornell University(C) Cornell University

Ray-Traced ImageFlat appearanceNo color reflecting to the eye

Radiosity ImageColor bleeds through due to diffuse reflection

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity: OverviewRadiosity: Overview

To alleviate these shortcomings radiosity determines intensities within the scene by modeling the energy exchange between objects

Eliminates the need for the crude concept of "ambient light"Based on thermal engineering methods for determining the reflection and emission of radiationAccounts for energy received + emitted by a purely diffuse surfacesBased on preservation of light emission and absorption in a static, closed environment

No time-varying scenes, i.e. lights have constant brightness and objects don't moveNo time-varying scenes, i.e. lights have constant brightness and objects don't moveNot suited for outdoor scenesNot suited for outdoor scenes

View-independent, since the energy exchange does not depend on the position of the viewer.

Rendering only requires hidden surface removalRendering only requires hidden surface removal

Page 5: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity: ProcessRadiosity: Process

Divide the scene into surface patches

Compute the energy emitted and received by each patch taking into account energy exchange between patches

Form factor computation to determine "coupling" between patchesSolving of simultaneous equations to compute steady state

Assign light intensity (color) to each patch based on the energy leaving a patch

Render the scene using flat shading or Gouraud shading

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity: DefinitionRadiosity: Definition

RadiosityRate at which energy leaves a surfaces

Measured as energy per unit-time and unit-area, e.g. W/m2

We have to consider rates - not absolute quantities - as otherwise the energy level in a scene would increase over time.

Page 6: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity of a Patch (1)Radiosity of a Patch (1)

Patch is a surface element in the scene

Radiosity a patch is the combination of the emitted radiosity and the radiosity received from another patch:

Bi: Radiosity of patch i [W/m2]Ei: Emitted radiosity [W/m2]ρi: Reflectivity of patch i [dimensionless]Fj-i: Form factor between patches i and j. [dimensionless]

Describes how much energy leaving patch j arrives on patch i.For instance to describe blocking objects.

Ai: Area of patch i [m2]

B E B FAAi i i j j i

j

ij

n

= + ⋅ ⋅−=∑ρ

1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Geometric InterpretationEi is the radiosity emitted by patch i

Aj Bj is the total power leaving patch j

Aj Bj Fj-i is the power from patch j reaching patch i

(Aj Bj Fj-i / Ai) is the radiosity of patch i due to patch j

ρi (Aj Bj Fj-i / Ai) is the radiosity reflected by patch i

Radiosity of a Patch (2)Radiosity of a Patch (2)

B E B FAAi i i j j i

j

ij

n

= + ⋅ ⋅−=∑ρ

1

dAj

Ni

dAi

Nj

r

θi

θj

Page 7: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity between Patches (1)Radiosity between Patches (1)

Percentage of visible area is the same for both patches

Therefore the radiosity equation simplifies to

Solving for the emitted energy gives

A F A F F FAAi i j j j i i j j i

j

i

⋅ = ⋅ ⇒ = ⋅− − − −

B E B Fi i i j i jj

n

= + ⋅ −=∑ρ

1

B B F Ei i j i jj

n

i− ⋅ =−=∑ρ

1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity between Patches (2)Radiosity between Patches (2)

Combining the radiosity expressions for all n patches results in a system of simultaneous equations:

The solution of this equation describes the steady-state exchange of radiosity within the sceneNote that form factors Fi-i are not always 0, e.g. for concave surfaces. Therefore, the matrix diagonals are not always 1.

11

1

1 1 1 1 1 2 1 1

2 2 1 2 2 2 2 2

1 2

1

2

1

2

− ⋅ − ⋅ − ⋅− ⋅ − ⋅ − ⋅

− ⋅ − ⋅ − ⋅

F

H

GGGG

I

K

JJJJ•

F

H

GGGG

I

K

JJJJ=

F

H

GGGG

I

K

JJJJ

− − −

− − −

− − −

ρ ρ ρρ ρ ρ

ρ ρ ρ

F F FF F F

F F F

BB

B

EE

E

n

n

n n n n n n n n n

KK

M M O MK

M M

Page 8: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity between Patches (3)Radiosity between Patches (3)

Solving this system of equations is often impracticalThe sheer size of the matrix makes inversion very expensiveThe matrix has nxn elements.

In practice, there are several thousands or tens of thousands of patches !In practice, there are several thousands or tens of thousands of patches !

This leads to storage and access problems (page faults etc.)Gaussian methods for matrix inversion are typically O(n3) !!

Therefore, iterative methods have been developedStart with an approximation of the solutionRefine until an error bound is not exceededSeveral iterative solution methods are available, e.g. Gauss-Seidel, Jacobi, Southwell or Overrelaxation

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Matrix Equations (1)Matrix Equations (1)

Generally the radiosity problem is desribed by a matrix equation in the form factor matrix K, the radiosity vector B and the emitter vector E:

We will iterate to generate a series of approximations to B. Each iteration's result will be numbered: B(g)

Residual is the difference between iterations:

We will not consider issues related to stability or convergence

K B E∑ =

r E K B( ) ( )g g= - ∑

Page 9: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Matrix Equations (2)Matrix Equations (2)

Relaxation methods adjust the result B(g) of iteration g to force one (!) element of r(g+1) to zero.

This will obviously affect the other values of r, but over many iterations the system will converge to the correct solution. Element i of r should be forced to zero with a different value for Bi:

r E K B E K B K B

BEK

KK

K B

ig

i i k kg

k

n

i i i ig

i k kg

kk i

n

ig i

i i

i k

i ii k k

g

kk i

n

( ),

( ),

( ),

( )

( )

,

,

,,

( )

!= − ⋅ = − ⋅ − ⋅ =

⇒ = − ⋅

= =≠

+

=≠

∑ ∑

1 1

1

1

0

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Matrix Equations (3)Matrix Equations (3)

Now the new value of Bi must be expressed in terms of its previous value:

r E K B E K B K B

rK

BEK

KK

K B

BEK

KK

K B BrK

ig

i i k kg

k

n

i i i ig

i k kg

kk i

n

ig

i ii

g i

i i

i k

i ii k k

g

kk i

n

ig i

i i

i k

i ii k k

g

kk i

n

ig i

g

i i

( ),

( ),

( ),

( )

( )

,

( )

,

,

,,

( )

( )

,

,

,,

( ) ( )( )

,

= − ⋅ = − ⋅ − ⋅

⇒ + = − ⋅

⇒ = − ⋅ = +

= =≠

=≠

+

=≠

∑ ∑

1 1

1

1

1

Page 10: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Solving Radiosity MatricesSolving Radiosity Matrices

The radiosity method describes how energy is exchanged or distributed between patches in the scene

Iterative methods solve the problem by refining the energy distributionWe distinguish between shot energy and unshot energy

The patch radiosity is the distributed, i.e. shot, energyThe difference between the emitted radiosity and the reflected radiosity is unshot energy

The residual r is a measure for the unshot energy, i.e. how much more/less energy the patches should be distributing into the scene

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Shot and Unshot RadiosityShot and Unshot Radiosity

For a given iteration g:Assume Ei = 0.

Bi is the radiosity currently sent into the environmentBj is the total radiosity received from other patchesρi Bj is the radiosity available for distribution into the scene

The difference between Bi and ρi Bj is "unshot" radiosity

Positive unshot radiosity: more Positive unshot radiosity: more incident radiosity than emittedincident radiosity than emittedNegative unshot radiosity: less Negative unshot radiosity: less incident radiosity than emittedincident radiosity than emitted

Patch

Bi

Bj

ρi j B

Biρi j B -

Page 11: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Jacobi Iteration (1)Jacobi Iteration (1)

This iterative method is the Jacobi Iteration

Initial value of all patch radiosities Bi is simply Zero or their emissive radiosity Ei

All patch radiosities are update in each iteration; this is fairly costly.

Convergence criteria include thresholds for residual or for change in Bi, e.g.

B E

r E K B

= ; / / Initialization

do{ = ; i : B = B + r / K

} / / Not Converged

while ( r[i] > T)

i i i i,i

- ∑"

$B B Ti

gi

g( ) ( )− <+ 1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Jacobi Iteration (2)Jacobi Iteration (2)

Physical interpretationThe radiosity of all patches is adjusted to represented the unshot energy

This method is rarely used for iterative approximationAt least initially, only few patches have significant amounts of unshot radiosity. Processing the other patches is wasteful.Sometimes a Jacobi step is the last step in an interation to distribute the remaining unshot radiosity.

Page 12: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Gauss-Seidel Iteration (1)Gauss-Seidel Iteration (1)

Variation on Jacobi Iteration

Jacobi method uses the new values Bi

(g+1) in the next interation

Instead Gauss-Seidel uses them immediately for computing the next new Bi.

This is somethat more efficient than the Jacobi method.Still all patch radiosities are update in every step.

B E= ; / / Initialization

do{ for (i = 0 ; i < n ; i + +)

=

} while ( r[i] > T)

n

B BB K

Ki ik i k

i ikk i

− ⋅

=≠

∑ ,

,1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Gauss-Seidel Iteration (2)Gauss-Seidel Iteration (2)

Physical InterpretationFor each patch all the radiosity from the other patches is collected.This process is applied to all patches in sequence.

B E K B E F B

B A E A F B A F A F A

B A E A F B A

i i i k kkk i

n

i i i k kkk i

n

i i i i i i k k ikk i

n

i k i k i k

i i i i i k i k kkk i

n

= + = +

= + =

= +

 Â

Â

Â

, ,

, , ,

,

1 1

1

1

ρ

ρ

ρ

Page 13: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Southwell Iteration (1)Southwell Iteration (1)

Another variation of Jacobi methodAdjusts only the patch radiosity Bi with the largest residual ri.This means that the algorithm focusses better on those patches with the most incorrect radiosity.

Jacobi and Gauss-Seidel would have adjusted that radiosity only every n-th step !Jacobi and Gauss-Seidel would have adjusted that radiosity only every n-th step !

However, to adjust an element repeatedly, the residual vector must be updated in between. This can be done incrementally:

B BrK

B Big

ig i

g

i ii

gi

g

g g g

( ) ( )( )

,

( ) ( )

( ) ( ) ( )

+

+

= + = +

= +

1

1

∆B B B

r E K B

E K B B

E K B K B

r K B

( ) ( )

( ) ( )

( ) ( )

( ) ( )

g g

g g

g g

g g

+ += − •= − • +

= − • − •= − •

1 1

∆∆

c h

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Southwell Iteration (2)Southwell Iteration (2)

B BrK

B Big

ig i

g

i ii

gi

g

g g g

( ) ( )( )

,

( ) ( )

( ) ( ) ( )

+

+

= + = +

= +

1

1

∆B B B

Observation:Only one element is updated, therefore:

The residual vector can therefore be updated by only considering column i of K:

r E K B

E K B B

E K B K B

r K B

( ) ( )

( ) ( )

( ) ( )

( ) ( )

g g

g g

g g

g g

+ += − •= − • +

= − • − •= − •

1 1

∆∆

c h∆B k ik

g( ) = ∀ ≠0

r r K B

r rKK

r rKK

kg

kg

k i ig

kg

kg k i

i ik

gk

g k i

i i

( ) ( ),

( )

( ) ( ) ,

,

( ) ( ) ,

,

+

+

= − ⋅⇒

= − ⋅ = ⋅ −FHG

IKJ

1

1 1

Page 14: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Southwell Iteration (3)Southwell Iteration (3)

Br E

r

= 0 ; / / Initialization ;

do{ select such that

} while ( > )

=

=

= +

=

∀ = − ⋅

i r

B Br

K

t r

k r r tKK

r T

i

i ii

i i

i

k kk i

i i

i

max( ) ;

:

,

,

,

Initialization:

Converges faster than Jacobi or Gauss-Seidel

r E K B E K 0 E( ) ( )0 0= − • = − • =

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Southwell Iteration (4)Southwell Iteration (4)

Physical interpretationThe iteration relaxes the element with the larges residual, i.e. the largest unshot radiosityThis means, the radiosity of this element is distributed into the environment. (Initially, this element is typically a light source.)

Different from Gauss-Seidel in that the radiosity is shot into the environment instead of being gathered.

Page 15: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Overrelaxation (1)Overrelaxation (1)

Applicable to all iteration methods discussed

Based on observation that radiosities Bi are adjusted several times before the residual is suffiently small

Instead overrelax the radiosities, i.e. adjust more than indicated by the Jacobi correction.Then the new residuals are no longer zero.

k>1: Overrelaxationk<1: Underrelaxation (useful for unstable systems)

B B k B

r k r

ig

ig

ig

ig

ig

( ) ( ) ( )

( ) ( )( )

+

+

= + ⋅⇒

= − ⋅

1

1 1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Overrelaxation (2)Overrelaxation (2)

Physical interpretationOverrelaxation overshoots a patch's energy in the expectation that in future iterations the patch will receive energy from other patches.

Page 16: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Progressive RefinementProgressive Refinement

Variation on Soutwell iterationSelect the element with the maximum unshot power instead of unshot radiosity, i.e. Ai ∆Bi

Picks the main contributors of power, instead of the elements with maximal radiosity, i.e. power density.

Additional refinements in progressive radiosityOn-demand computation of form factors reduces storage required for form factor matrixEstimation of ambient lighting, accounting for the unshot radiosity

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Estimated Ambient LightingEstimated Ambient LightingEstimating the unshot radiosity

Sum of the residual values is the unshot radiosity:

Also compute an average reflectivity:

Releasing the unshot energy into the scene and reflecting it repeatedly off all objects will create a new ambient radiosity:

The ambient radiosity can be added to all patches

This result in faster convergence, because all patches receive some energy immediately instead of only after many iterations.

∆∆

BB AA

i i

i

= ∑∑

ρρ

= ∑∑

i i

i

AA

B BB

A = ⋅ + + + + =−

∆ ∆1

12 3ρ ρ ρ

ρ Ke j

B B Bi i i A'= + ρ

Page 17: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form FactorsForm Factors

Remember: Fi-j is the portion of energy leaving patch i reaching patch j

Since form factors are central to all radiosity methods we will consider several methods to compute them

Analytical computationMeasure them using physical experimentsApproximation

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Analytical Computation (1)Form Factors: Analytical Computation (1)

Consider infinitesimally small surface elements dAi and dAj

Hij is 1 if dAi is visible from dAj and 0 otherwisedFdi-dj is called the differential form factor

dFr

H dAdi dji j

ij j− =⋅

⋅ ⋅cos cosθ θ

π 2

dAi

Ni

dAj

Nj

r

θi

θj

Page 18: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Analytical Computation (2)Form Factors: Analytical Computation (2)To determine the differential-to-finite form factor from a surface element dAi to the entire patch j, we integrate over all the surface elements on patch j:

The average finite form factor between the patches is the average of all the point form factors on patch i:

Differential-to-finite form factor can approximate the finite form factor.

FA r

H dA dAi ji

i jij j

AAi

ji

− =⋅

⋅ ⋅ ⋅zz12

cos cosθ θπ

Fr

H dAdi ji j

ij jA j

− =⋅

⋅ ⋅zcos cosθ θπ 2

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Analytical Computation (3)Form Factors: Analytical Computation (3)

Analytical solution of this area integral is often complicated

Closed solutions exist for simple geometriesMore complex geometries may not have a closed form solution

Conversion of the area integrals to contour integrals simplifies the computation

Stoke's theorem relates integrals over an area to integrals over the area's contourRequires that patches are completely visible to each other

Page 19: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemisphere Method (1)Form Factors: Hemisphere Method (1)

The differential-to-finite form factor can be computed using two projection steps

Project Aj onto a hemisphere with radius R=1, centered at dAi: Aj'

Then project Aj' onto the base of the hemisphere: Aj''

Then, the form factor Fdi-j is the ratio of Aj'' to the base of the hemisphere.

Redrawn from A. Glassner, Principles in Image Synthesis

Aj’Aj

dAj

θj

θi

ω i

Aj’’dAi

r

R=1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemisphere Method (2)Form Factors: Hemisphere Method (2)

Project Aj to Aj'Project of dAj to dAj'

This is the solid angle dω j subtended by dAj'

Now project dAj' onto the base of the hemisphere

Pulling everything together:

dA dA rj j j' cos= ⋅ θ 2

d dAj jω = '

dA dAj j i' ' ' cos= ⋅ θ

dA dArj j

i j' 'cos cos

= ⋅⋅θ θ2

Aj’Aj

dAj

θj

θi

ω i

Aj’’dAi

r

R=1

Page 20: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemisphere Method (3)Form Factors: Hemisphere Method (3)

The differential form factor is the portion of the hemisphere base covered by dAj:

Assume hemisphere with radius 1, i.e. area = π

The differential-finite form factor is computed by integrating of Aj

FdA

dAr

di djj

ji j

− =

= ⋅⋅

' '

cos cosπ

θ θπ 2

Fr

dAdi ji j

jA j

− =⋅

⋅zcos cosθ θπ 2

Aj’Aj

dAj

θj

θi

ω i

Aj’’dAi

r

R=1

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Solid AngleForm Factors: Solid Angle

ConceptFrom a given viewpoint, an object covers a certain area of the viewThis is the solid angle

Definition3D analog to a 2D angle measured in radians [rad]The solid angle subtended by an object is the area of its projection onto a unit sphereMeasured in steradian [sr].Applies to all types of objects

r=1

A

Page 21: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Projection MethodsForm Factors: Projection Methods

Recall that

The total solid angle is

Precompute a differential form factor Fdi,∆ω for a given ∆ω i

The ∆ωi do not overlap.Hence, the differential-finite form factor is:

d dAj jω = '

Aj’Aj

dAj

θj

θi

ω i

Aj’’dAj

r

ω ωj j≈∑ ∆

F Fdi j di j- ªÂ ,Dω

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (1)Form Factors: Hemi-Cube (1)

Computing form factors and solid angles for a hemisphere is costly

Use a hemicube instead of the hemisphereHemicube is centered around the patchBase of the cube parallel to the patchSimpler because of planar faces

Further simplifiy solid angle calculation by subdiving the faces of the cube with a grid

Each grid cell approximates a solid angleForm-factors are precomputed for each grid cellTypical grid resolutions range from several ten to several hundred

Page 22: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (2)Form Factors: Hemi-Cube (2)

Aj

dAi

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (3)Form Factors: Hemi-Cube (3)

Form factor for cell P:

Top Face:

Side Faces:

∆ ∆Fr

APi j

P

=⋅⋅

⋅cos cosθ θ

π 2

r x yr

FA

x y

P P P i jP

P

P P

= + + = =

⇒ =+ +

2 2

2 2 2

11

1

; cos cosθ θ

π∆ ∆

c h

r x yzr r

FA z

x y

P P P iP

Pj

P

PP

P P

= + + = =

⇒ = ⋅+ +

2 2

2 2 2

11

1

; ; cos cosθ θ

π∆ ∆

c h

Page 23: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (4)Form Factors: Hemi-Cube (4)

AdvantagesUse standard polygon rendering techniques to determine the grid cells coveredHardware z-buffering makes this process fastApplicable to different primitive types

Basic assumption: Form factor at the patch center is representative for the entire patch

ProblemsProximitiy: Form factors change noticeably if patches are closeVisibility: Form factors vary over the patch in the presence of occludersAliasing

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (5)Form Factors: Hemi-Cube (5)

Proximity AssumptionThe distance between patches is large compared to the patch sizes

If this assumption is not valid, the form factor is not (even roughly) constant across the patch

Form factor is different for the 3 hemicube positions

Aj

Ai

Page 24: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (6)Form Factors: Hemi-Cube (6)

Visibility AssumptionIf patch j is visible from the center of patch i, then patch j is visible from everywhere on patch i.

This assumption is violated when objects are in between the patches.

Aj

Ai

Occluder

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Hemi-Cube (7)Form Factors: Hemi-Cube (7)

Aliasing AssumptionThe sampling frequency defined by the hemicube grid samples all objects in the environment correctly.

In general, this assumption is not valid Therefore, sampling artifacts (aliasing) are to be expected as discussed earlier, e.g.

Incorrect form factorsStaircasingMissed or incompletely sampled objects. This can very noticeable for a large object lit by a distant light source.

Page 25: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Other Sampling SurfacesForm Factors: Other Sampling SurfacesInstead of using the gridded hemicube other surfaces can be used

Large (infinite) plane parallel to the patchPlane is adaptively subdivided, similar to quadtreesMay miss distant objects along the horizon. However, these objects typically do not contribute much to a patch's radiosity.

Gridded hemisphereSimilar to the gridded hemicube, e.g. along latitude and longitudeDifficult to scan-convert to a spherical surface

Gridded hemisphere baseRequires fewer cells than a gridded hemicube with comparably accurate form factorsRequires efficient method to project objects onto the hemisphere

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Form Factors: Adaptive SubdivisionForm Factors: Adaptive Subdivision

What if the basic assumptions for computing form factor (proximity, visibility, aliasing) are violated ?

Can be traced back to large a variation of radiosity over the patchSubdividing the patch into smaller patches can reduce the error

In order to contain the added complexity, patches are subdivided adaptively

Subdivide if difference between radiosity on patch vertices exceeds a given thresholdRegular subdivision, e.g. divide the patch into n smaller patchesDiscontinuity meshing adapts the subdivision to follow features that cause the violation of the assumptions

For instance subdivide along an edge creating a shadow. For instance subdivide along an edge creating a shadow.

Requires computation of new form factors for the new sub-patches

Page 26: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Rendering Radiosity SolutionsRendering Radiosity Solutions

Radiosities have been computed per patchTranslating radiosities into color results in flat shaded imagesSmooth shaded images (Gouraud shading) can be rendered by computing vertex radiosities as averages of the radiosities of the adjacent faces

Details in the textbook !Details in the textbook !

Radiosity solutions are view-independentRadiosity method assumes perfectly diffuse materialsTherefore, there is no directional preference in how light is reflectedRadiosity solution must be computed once for all viewpointsOnce computed, walkthroughs can be performed at the speed of regular Gouraud shading !

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity Examples: "Cornell Box"Radiosity Examples: "Cornell Box"

Radiosity simulation Photo of the real boxControlled lighting conditions

(C) Cornell University (C) Cornell University

Page 27: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Radiosity Examples: FactoryRadiosity Examples: Factory

(C) Cornell University, 1988

In 1988, on a VAX8700:

30,000 patchesRadiosity solution: 5 hrsRendering: 190 hrs

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Ray-Tracing and RadiosityRay-Tracing and Radiosity

Ray-TracingView-dependent and specular reflection only

Lighting model can simulate diffuse and ambient lightingLighting model can simulate diffuse and ambient lighting

RadiosityView-independent and diffuse reflection only

Radiosity and Ray-Tracing can be combined to capture both diffuse and specular effects

First pass: view-independent radiosity solution with extra information about specular distribution of lightSecond pass: view-dependent ray-tracing

A bit more detail in the textbook

Page 28: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

SummarySummary

Radiosity simulates the power distribution in the sceneSimulates exchange of light between patchesExchange is determined by the amount of light received from other patches and the reflectivity of patches.Only applies to purely diffuse environments. View-independent.

1. Determine coupling between patches by computing form factors2. Solve simultaneous equations for the steady state of the system.

Form factor computation can be accelerated with z-buffer hardwareRadiosity solution can be approximated using iterative methods

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

HomeworkHomework

Study radiosity (chapter 16.13)For further study see A. Glassner, Principles of Digital Image Synthesis (Vol. 2), Morgan Kaufman.

Prepare color theory (chapter 13) and graphics hardware (chapter 4.1-5)

Page 29: Computer Graphics - Week 11feiner/courses/csw4160/slides/S99-11.pdf · Assignment 4 You should have started by now There will not be an extension on the deadline because of department

© Bengt-Olaf Schneider, 1999Computer Graphics – Week 11

Next Week ...Next Week ...

Graphics Hardware

Color Theory

Electron Beam

Cathode

Control Grid

Electron Lens

VerticalDeflection

System

HorizontalDeflectionSystem

CollectorElectrode

Phosphor

S

V

H

Cyan

Blue Magenta

Red

YellowGreen

White

Black