40
1 06/27/22 15:14 Graphics II 91.547 Global Rendering and Radiosity Session 9

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

Embed Size (px)

Citation preview

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

104/20/23 18:10

Graphics II 91.547

Global Rendering and Radiosity

Session 9

Page 2: 111/17/2015 17:21 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

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

304/20/23 18:10

Energy Flow across a Surface

dA

n

( )

E dA

E dA

( ) ( )

( ) ( )cos

n

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

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

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

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

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

604/20/23 18:10

Radiosity: Energy emitted from a surface per unit area

dApBd

dpLpB

)(

),()(

Therefore:

dAp

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

704/20/23 18:10

Irradiance: Energy arriving at a surface per unit area

dpLdA

dpE

dApEd

cos),(),(

)(

dAp

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

804/20/23 18:10

Reflectance:Bi-Directional Reflectance Function (BDRF)

n

i r

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

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

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),(),,(),(),(

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1704/20/23 18:10

Perfectly Diffuse Reflectivity

i

)(L

Energy is reflected uniformly in alldirections

)(rL

1,0

),,(

ipf

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

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

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

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

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

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

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

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

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

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:

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

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

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

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

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

2504/20/23 18:10

Equivalent Projection Areas

A

B

C

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

2604/20/23 18:10

Hemicube

Patch i

Patch j

Projection of patch jonto hemicube “pixels”

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

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

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

2804/20/23 18:10

Hemicube Algorithm HandlingOcclusion Issue

Patch i

Patch j

Patch k

FikFij

Hemicube

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

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

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

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

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

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

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

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

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

3304/20/23 18:10

Number of Patches = 124

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

3404/20/23 18:10

Number of Patches = 829

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

3504/20/23 18:10

Number of Patches = 124Number of Elements = 829

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

3604/20/23 18:10

Number of Patches = 58Number of Elements = 1135

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

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

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

3804/20/23 18:10

Rendering CausticsArvo, 1986

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

3904/20/23 18:10

Combining Radiosity and Ray Tracing

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

4004/20/23 18:10

Combined Radiosity and Ray Tracing