111/17/2015 17:21 Graphics II 91.547 Global Rendering and Radiosity Session 9

Preview:

Citation preview

104/20/23 18:10

Graphics II 91.547

Global Rendering and Radiosity

Session 9

204/20/23 18:10

A More Sophisticated View ofThe Nature of Light

Ray Oriented View

• Used in Phong shading and in ray tracing • Single direction• Zero width• Notion of intensity

Flux intensity view

• Vector field represents energy flow per unit time per unit area

• Finite beam widths

304/20/23 18:10

Energy Flow across a Surface

dA

n

( )

E dA

E dA

( ) ( )

( ) ( )cos

n

404/20/23 18:10

Flux and Energy Conservation

dd,),A(dd'd,)',,k(dd,

'ddd,),',k(dd,

VVS

VV

pppppppp

ppppp

+ ++=

Emission + in scattering = streaming + outscattering + absorption

504/20/23 18:10

Radiance:Energy emitted from a surface per unit projected area, per unit solid angle of direction

dAdpLd

pLpL

cos),,(

),(),,(

Energy emitted per surface area, per steradian (solid angle)

Therefore:

dAp

d

604/20/23 18:10

Radiosity: Energy emitted from a surface per unit area

dApBd

dpLpB

)(

),()(

Therefore:

dAp

704/20/23 18:10

Irradiance: Energy arriving at a surface per unit area

dpLdA

dpE

dApEd

cos),(),(

)(

dAp

804/20/23 18:10

Reflectance:Bi-Directional Reflectance Function (BDRF)

n

i r

),(),,(),( irir pEpfpL

904/20/23 18:10

The Radiance Equation

At any surface: radiance = emitted radiance + total reflected radiance

For any incoming direction the reflected radiance in direction is the Irradiance multiplied by the BRDF:

i

iii dpLpf cos),(),,(

Integrating over the hemisphere of all incoming directions at p gives:

iii dpLpf cos),(),,(reflection total

The radiance equation for outgoing radiance is therefore:

iiiie dpLpfpLpL cos),(),,(),(),(

1004/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:All we really need to know for rendering?

Material Surface Properties

Light Sources

PlenopticFunction

1104/20/23 18:10

Types of Solution to Radiance Equation

Local Global

View Dependent OpenGL Phong Lighting Recursive Ray Tracing

Monte Carlo Ray Tracing

View Independent Flat or Smooth Defined Color (No Lighting)

Radiosity

Monte Carlo Photon Tracing

1204/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:Defined Color: No Lighting

Solved atVertices

All objects are “emitters” according toglColor*()

No reflections considered

1304/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:OpenGL Lighting Model

Objects can beemitters

Restricted to Point Light Sources

PhongBDRF

Solved atVertices

1404/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:Recursive Ray Tracing

Objects can beemitters

Restricted to Point Light Sources +Single Reflected &Refracted Ray

PhongBDRF

Solved forRays ThroughPixels

1504/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:Monte Carlo Ray Tracing

Objects can beemitters

Rays cast recursively,chosenaccording to BDRF

ActualBDRF

Solved forRays ThroughPixels

1604/20/23 18:10

iiiie dpLpfpLpL cos),(),,(),(),(

The Radiance Equation:Radiosity

Objects can beemitters – emissionassumed constant andindependent of angle

Constantreflectivity

Assumed constantover surface “patches”independent of angle

Assumed constantover surface “patches”independent of angle

1704/20/23 18:10

Perfectly Diffuse Reflectivity

i

)(L

Energy is reflected uniformly in alldirections

)(rL

1,0

),,(

ipf

1804/20/23 18:10

Radiosity

0 Based on the theory of heat transfer (energy) between surfaces (Siegel 1984)

0 Adapted to computer graphics by Goral et al. (Goral 1984)0 Based upon conservation of energy0 Surfaces are assumed to be perfectly diffuse (lambertian)

reflectors0 Environment is divided into “patches”0 Radiosity of a patch is the total rate of energy leaving the

patch- Assumed constant over the patch- Equal to sum of emitted and reflected energy

0 Interaction among patches modeled by unitless form factors- Fij defined as the fraction of energy leaving dAi that

arrives at dAj

1904/20/23 18:10

The Basic Radiosity Relationship

jij

j

jiiiii FdABdAEdAB

Radiosity x area = emitted energy + reflected energy

For an environment divided into n patches:

jjiiij

j

jjijiiiii

AFAF

AFBAEAB

(reciprocity)

B E B Fi i i jj

n

ij

1

2004/20/23 18:10

Resulting System of Equations

1

1

1

1 11 1 12 1 1

2 21 2 22 2 2

3 31 3 32 3 3

1 2

1

2

3

1

2

3

F F F

F F F

F F F

F F F

B

B

B

B

E

E

E

E

n

n

n

n n n n n nn n n

2104/20/23 18:10

Stages in Radiosity Solution

Discretized environment

Form factorcalculations

Full matrix solution

Standard renderer

Change scenegeometry

Change colorsor lighting

Change view

Specific View

2204/20/23 18:10

Calculating the Form Factors:Energy reaching Aj from Ai

AidAi

i

d ij

j

Aj

dAj

dE dA I d dA

ddA

r

dE dAI dA dA

r

i i i i ij i

ij jj

i ii i j i j

cos

cos

cos cos

2

2

Differential energy leaving Ai that reaches Ajis given by:

Solid angle subtended by Aj at Ai can be expressed:

Substituting gives:

2304/20/23 18:10

Calculating the Form Factors:Calculating the Energy Fraction

FdA dA

dA

dA I d dA I

FI dA dA

dA I r

dA

r

FdA

r

FA

dA dA

r

dAidAjj i

i

i i i i i

dAidAji i j i j

i i

i j j

dAiAji j j

Aj

A A

i

i j j i

i j

Radiative energy reaching from

Total energy leaving in all directions

Total energy = cos

cos cos cos cos

cos cos

cos cos

2 2

2

2

1

2404/20/23 18:10

The Nusselt Analogue (Siegel 1984)

Patch

Projection onto surfaceof hemisphere

Projection onto base ofcircle

F FdA

rij dAiAji j j

Aj

cos cos

2

2504/20/23 18:10

Equivalent Projection Areas

A

B

C

2604/20/23 18:10

Hemicube

Patch i

Patch j

Projection of patch jonto hemicube “pixels”

2704/20/23 18:10

Summing Delta Form Factors onPixels onto which Aj Projects

Patch i

FaFb

FcFd

Patch j

F F F F Fij a b c d

2804/20/23 18:10

Hemicube Algorithm HandlingOcclusion Issue

Patch i

Patch j

Patch k

FikFij

Hemicube

2904/20/23 18:10

Stages in Radiosity Solution

Discretized environment

Form factorcalculations

Full matrix solution

Standard renderer

Change scenegeometry

Change colorsor lighting

Change view

Specific View

N x N

N x N

ComputationCost Storage

N x N

3004/20/23 18:10

“Gathering”

B

B

B

B

E

E

E

E

F F F

B

B

B

B

i

n

i

n

i i i i i in i

n

1

2

1

2

1 2

1

2

Patch i

Fi1Fi2

Fi3

3104/20/23 18:10

“Shooting”

ii

ii

ii

i

nn F

F

F

B

E

E

E

B

B

B

1

1

1

2

1

2

1

Patch i

Fi1Fi2

Fi3

3204/20/23 18:10

Progressive Refinement Radiosity Algorithm

repeat for (each patch i) [Position a hemicube on patch I and calculate form factors Fij for the first iteration] for (each patch j (j!=I)) do

rad = j Bi Fij Ai/Aj Bj = Bj + rad Bj=Bj+ rad Bi=0until convergence

3304/20/23 18:10

Number of Patches = 124

3404/20/23 18:10

Number of Patches = 829

3504/20/23 18:10

Number of Patches = 124Number of Elements = 829

3604/20/23 18:10

Number of Patches = 58Number of Elements = 1135

3704/20/23 18:10

Comparison of Images

124 Patches 5.36 min. 829 Patches 96.46 min.

124 Patches, 829 Elements 32.6 min. 58 Patches, 1135 elements 23.59 min

3804/20/23 18:10

Rendering CausticsArvo, 1986

3904/20/23 18:10

Combining Radiosity and Ray Tracing

4004/20/23 18:10

Combined Radiosity and Ray Tracing

Recommended