1 Radiosity - Basics Radiosity - Basics Based on thermal - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 Radiosity - Basics Radiosity - Basics Based on thermal - - PDF document

Computer Graphics as Virtual Photography real camera photo Photographic Photography: scene (captures processing print Radiosity light) processing camera Computer 3D synthetic tone model Graphics: models image reproduction


slide-1
SLIDE 1

1 Radiosity

Don Greenberg Michael Cohen

Computer Graphics as Virtual Photography

camera (captures light) synthetic image camera model (focuses simulated lighting)

processing

photo processing tone reproduction real scene 3D models Photography: Computer Graphics: Photographic print

Assignments

  • Checkpoint 5

– Due today

  • Checkpoint 6

– To be given today

  • RenderMan

– Due Nov 3rd

Projects

  • Project feedback
  • Approx 22 projects
  • Listing of projects now on Web
  • Presentation schedule

– Presentations (15 min max) – Last 3 classes (week 10 + finals week) – Sign up

  • Email me with 1st , 2nd , 3rd choices
  • First come first served.

Today’s Class - Radiosity

  • Basics
  • The Radiosity Equation
  • Form Factors

– What they are – The hemicube solution

  • Solving the Radiosity Equation
  • Rendering
  • Generating Meshes

..but first

  • A video overview
slide-2
SLIDE 2

2 Radiosity - Basics

  • Ray tracing

– Great for specular type reflections – Handles hidden surface calculations – Doesn’t handle diffuse (inter-)reflections. – View dependent

  • Radiosity

– Gorel, Torrance, et al. from Cornell! – More accurate solution to ambient light – Not as elegant as ray tracing – More physically-based

Radiosity - Basics

  • Based on thermal engineering models for

emission and reflection of radiation

  • Assumes the conservation of light energy in a

closed system, i.e., that steady state can be reached

  • Assumes that all surfaces are perfectly diffuse
  • To get radiant exitance at each point, a VERY

large system of linear equations must be solved

Radiosity - Basics

  • Radiant exitance - radiant flux out (misnamed

radiosity by CGers)

dA

dA d M Φ =

Radiosity - Basics

  • First determine all light interactions in an

environment in a view independent way.

  • Then create image using calculated radiant

exitance values in a standard rendering process.

– i.e., radiosity defines a “made to fit” texture mapping

Radiosity - Basics

  • Program Flow

[Sillion,35]

Radiosity - Basics

  • View dependence vs view independence

– Radiosity provides a view independent solution – Then rendered from a given view point.

  • Not points -- But patches

– Scene is subdivided into patches – Radiant exitance is calculated for each patch

slide-3
SLIDE 3

3 Radiosity - Basics

  • Patches

[Ashdown,7]

Radiosity - Basic Idea

  • Each patch has two values associated with it:

– Its illumination (how brightly lit) – Its surplus energy (radiant energy)

  • Each patch will receive light from the environment
  • It will reflect a fraction back
  • Keep track of amount of light reflected back and

where it went to

  • Continue until all light has been distributed.

Radiosity - Key Idea

  • Since all objects are perfectly diffuse, can

determine where light distribution by simply considering the geometry of the scene.

  • Closed form solution
  • Calculation of radiant exitance per patch is

given by the radiosity equation.

surfaces

  • ther

from light 1 e reflectanc

  • ut

flux init exitance

=

+ =

n j ij j i

  • i

i

F M M M ρ

The Radiosity Equation

  • For each patch i, the Mi is the radiant exitance
  • f that patch.
  • All surfaces are perfectly diffuse, i.e.

reflectivity is equal in all directions

– Reflectance for each patch is a constant ρi – ρi can be wavelength dependent.

  • Geometry term Fi,j indicates the fraction of

flux leaving patch i and arriving at patch j.

surfaces

  • ther

from light 1 e reflectanc

  • ut

flux init exitance

=

+ =

n j ij j i

  • i

i

F M M M ρ

Radiosity Equation

  • Radiosity vs Rendering Equation

surfaces

  • ther

from light 1 e reflectanc

  • ut

flux init exitance

=

+ =

n j ij j i

  • i

i

F M M M ρ

[ ]

′ ′ ′ ′ ′ ′ ′ ′ + ′ ′ = ′

S

x d x x I x x x x x x x g x x I ) , ( ) , , ( ) , ( ) , ( ) , ( ρ ε

Radiosity System of Equations

  • Rearrange terms

=

+ =

n j ij j i

  • i

i

F M M M

1

ρ

=

− =

n j ij j i i

  • i

F M M M

1

ρ

slide-4
SLIDE 4

4 Radiosity System of Equations

  • Expand the terms

) ( ) (

2 2 1 1 2 22 2 2 21 2 2 2 2 nn n n n n n n n

  • n

n n n

  • F

M F M F M M M F M F M F M M M ρ ρ ρ ρ ρ ρ + + + − = + + + − = … … … ) (

1 12 2 1 11 1 1 1 1 n n n

  • F

M F M F M M M ρ ρ ρ + + + − = …

Radiosity System of Equations

  • Put into matrix form

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − − − − − = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡

n nn n n n n n n n

  • n
  • M

M M F F F F F F F F F M M M

… … … … … … … … …

2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 2 1

1 1 1 ρ ρ ρ ρ ρ ρ ρ ρ ρ

Radiosity System of Equations

  • Put in matrix notation

M T I M o ) ( − =

Mo = initial n x 1 exitance vector I = n x n identity matrix M = final n x 1 exitance vector T = n x n matrix whose i,j element is ρiFij

known Trying to find Still Need

Radiosity - Form Factors

  • Form factors are based solely on geometry:

– Given the radiant exitance of a patch Ei, what fraction of it is received by another patch Ej? – Remember: All patches are Lambertian surfaces and distribute flux (radiant exitance) equally in all directions.

Radiosity - Form Factor

Note: A’s and dA’s in this slide are denoted by E’s on other slides! Note:

  • r is distance

between surfaces

  • φi & φI relative
  • rientations
  • dAi & dAI

relative areas

  • cos φi cos φI

differential angle [0,1]

  • bigger φi & φI

mean smaller Fij

Radiosity - Form Factor

  • Notice that

– Area of patches must be relatively small compared to distances between them – Full visibility between patches is assumed – Patches are not points nor are they differential areas – Must in the end integrate over each patch.

slide-5
SLIDE 5

5 Radiosity - Form Factor

  • Integration over patches (here dE is same as dA in

previous slide)

[Ashdown, 43]

Radiosity - Form Factors

  • The final expression!

j i A A j i i ij

dA dA r A F

i j

∫ ∫

=

2

cos cos 1 π θ θ

Hij

Remember we assumed all patches could get to all others, the Hij term, if added, is the visibility factor

Radiosity - Form Factor Facts

  • Solution first developed in 1760 by Lambert
  • AiFij = AjFji - Useful to find pairs of form factors
  • Form factor calculation assumes a nonparticipating

medium (like air or vacuum)

=

=

n j ij

F

1

1

= n i 1

Radiosity - Form Factors

  • So how do we solve this thing?

– There is an analytic solution. But it is very ugly and impractical (note: discovered in 1993) – Classic solution: The Hemicube method

Radiosity - Nusselt’s Analogy

  • Computing FdEi-Ej is equivalent to

– Projecting those parts of Ej that are visible from dEi onto a unit hemisphere centered about dEi – Then, projecting this projected area

  • rthogonally onto the base of the hemispheres

– Finally, dividing by the area, i.e.., FdEi-Ej =

A/π

Radiosity - Form Factors

Nusselt’s Analogy

  • Project Ej onto plane
  • f surface of a

hemisphere

  • Form factor is a

fraction of the projected surface area with respect to this projected area, i.e.., FdEi-Ej = A/π

[Ashdown, 273]

slide-6
SLIDE 6

6 Radiosity - Form Factors

  • Note from Nusselt’s Analogy that patches Ej and Ek

have the same form factor from patch dEi

[Ashdown, 275]

Radiosity - Form Factors - Hemicube

  • Image precision projections
  • Replace hemisphere with hemicube.
  • Hemicube is divided into equal sized square cells.
  • Can determine form factor for each cell (delta form

factors).

  • The form factor for a patch is the sum of delta form

factors for cells that the projection of the patch covers.

Hemicube and Nusselt’s Analogy

  • Why the hemicube works

[Watt&Watt, 278]

Radiosity - Form Factors - Hemicube

  • Hemicube - Imagine that dEi represents a pinhole

camera; hemicube is what it sees.

[Ashdown, 276]

Radiosity - Form Factors - Hemicube

  • Hemicube - Delta Form Factors

– Gives an approximation of form factor for a cell on the hemicube.

j j i E dE

A r F

j i

∆ ≈

− 2

cos cos π θ θ Radiosity - Form Factors - Hemicube

  • Need a hemicube for each dEi
  • Stores patch ids of closest intersection patch

and contains precomputed delta form factors

  • Shooting light from source patch to destination

through hemicube

  • Scale amount of shooter’s radiative energy by

delta form factor associated with hemicube

slide-7
SLIDE 7

7 Radiosity - Form Factors

Radiosity - Hemicube Form Factor Facts

  • Relatively inexpensive to compute
  • Delta form factors can be precomputed once

then applied to each patch

  • Calculation of form factors involves

projection and summation.

  • Accuracy depends on hemicube resolution.
  • Most popular means of calculating form

factors

Radiosity - Recap

[Sillion,35]

Radiosity - Recap

  • Divided our scene into n patches
  • Set up this system of n equations:

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − − − − − = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡

n nn n n n n n n n

  • n
  • M

M M F F F F F F F F F M M M

… … … … … … … … …

2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 2 1

1 1 1 ρ ρ ρ ρ ρ ρ ρ ρ ρ

Radiosity - Recap

  • For each i,j combination, calculate the form factor Fij
  • Now need to solve the radiosity equation for

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − − − − − = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡

n nn n n n n n n n

  • n
  • M

M M F F F F F F F F F M M M

… … … … … … … … …

2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 2 1

1 1 1 ρ ρ ρ ρ ρ ρ ρ ρ ρ

Solve the Radiosity Equation

  • By gathering - use numerical techniques such as

Jacobi / Gauss-Sidel methods (can be done in parallel)

– Calculates full radiosity solution – Θ (n2)

  • By shooting - progressive refinement

– Approximate solution – Better solution with each iteration.

slide-8
SLIDE 8

8

Radiosity - Progressive Refinement

  • Solves

– Memory requirements – Lessens processing time – Preview work in progress

  • Based on flux (radiant exitance) left to be

distributed in scene.

Radiosity - Progressive Refinement

  • At each iteration, only consider the patch with

most the flux yet to be distributed.

  • Continue until flux left to be distributed falls

below a threshold.

  • If threshold = 0, equivalent to full solution.

Radiosity - Progressive Refinement

  • Shooting flux into environment

surfaces

  • ther

from light 1 e reflectanc

  • ut

flux init exitance

=

+ =

n j ij j i

  • i

i

F M M M ρ

Radiosity - Progressive Refinement

  • For each patch i we keep track of:

– Mi - current amount of radiant exitance – ∆Mi - current amount of radiant exitance gained since last iteration – ∆Miunsent - amount of unsent radiant exitance since last iteration

  • Munsent is the total amount of unsent flux =

∆Mi

unsent Ai

Radiosity - Progressive Refinement

  • Initialize Mi, ∆Mi, ∆Miunsent = Moi
  • While Munsent > Threshold

– Find element i with greatest ∆Mi

unsentAi

– For each other element j

  • Calculate form factor Fij
  • Calculate ∆Mi, change of Mi, due to ∆Mi

unsentAi

  • Update ∆Mj

unsent

  • Update Total Mj

– Set ∆Munsent for element i to 0

Radiosity - Progressive Refinement

  • Solution gets progressively better with each

iteration

  • Later iterations contribute less to total

solution than earlier iterations

  • Limit is equivalent to complete solution.
slide-9
SLIDE 9

9

Radiosity - Progressive Refinement Radiosity - Progressive Refinement

[Cohen, 121] [Sillion, Plate 9] Gauss-Seidel 1, 2, 24, 100 Steps Progressive Refinement 1, 2, 24, 100 Steps

Radiosity - Progressive Refinement

[Sillion, Plate 9] Progressive Refinement with Ambient Term 1, 2, 24, 100 Steps

Radiosity – Where are we?

  • Radiosity solution gives us

a view independent solution

  • “Made to fit” texture

mapping

  • Use traditional rendering to

get view dependent image

– Flat / Gouraud shading / Z- buffer – Non-recursive ray tracing

[Sillion,35]

Radiosity – view independence

  • Once a radiosity solution is calculated

– As long as the scene doesn’t change – Can be used for multiple viewpoints – E.g. architectural walkthrus. – Example (M. Rubbleman)

Radiosity - Summary

  • Based on thermal

engineering models for emission and reflection of radiation

  • Assumes the conservation of

light energy in a closed system, i.e., steady state can be reached

  • Assumes diffuse surfaces
  • Computationally intensive

[Sillion,35]

slide-10
SLIDE 10

10 Radiosity - Meshing strategies

  • How do we efficiently divide scene into

patches

– Adaptive Subdivision – Only need subdivision in high contrast areas where there is a dramatic change in energy across a relatively small area

  • shadow boundary
  • light source

Radiosity - Adaptive Subdivision

  • Once a surface has fully emitted its energy,

each patch is visited and a decision is made to subdivide patches if two adjoining patches have too much difference in their illumination values

  • Notice there is a difference between

subdividing to make patches and to do energy collection

Radiosity - Adaptive Subdivision

[Sillion,73]

Radiosity

  • Further Reading

– Ashdown, Radiosity: A Programmer’s Perspective – Cohen & Wallace, Radiosity and Realistic Image Synthesis – Sillion & Puech, Radiosity & Global Illumination – Watt & Watt – Foley & Van Dam