Radiosity
Ray Tracing and Radiosity Form Factors Enhancements Two-pass Rendering Ray Tracing and Radiosity Form Factors Enhancements Two-pass Rendering
Thursday, April 1, 2010
Radiosity Ray Tracing and Radiosity Ray Tracing and Radiosity Form - - PowerPoint PPT Presentation
Radiosity Ray Tracing and Radiosity Ray Tracing and Radiosity Form Factors Form Factors Enhancements Enhancements Two-pass Rendering Two-pass Rendering Thursday, April 1, 2010 Outline Outline A Brief Review/Introduction to Radiosity
Ray Tracing and Radiosity Form Factors Enhancements Two-pass Rendering Ray Tracing and Radiosity Form Factors Enhancements Two-pass Rendering
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 3 3
A Brief Review/Introduction to Radiosity
The Radiosity Equation, Form Factors
Putting it all together, and Improving
More Realism: A digression, and Two-
Pass Rendering Rendering
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 4 4
Review: Local vs. Global Illumination Review: Local vs. Global Illumination Local illumination: Local illumination: Phong Phong model model (OpenGL, most real (OpenGL, most real-
time graphics)
– – Light to single surface point to viewer Light to single surface point to viewer – – FAST FAST – – Vastly simplified Vastly simplified – – No representation of many natural No representation of many natural phenomena (shadows, inter phenomena (shadows, inter-
reflections) without additional hacks without additional hacks
Local Illumination
effects
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 5 5
Review: Local vs. Global Illumination Review: Local vs. Global Illumination
Global illumination: Ray tracing Ray tracing
– – Realistic specular reflection/transmission Realistic specular reflection/transmission – – Simplified diffuse reflection* Simplified diffuse reflection*
Global illumination: Radiosity Radiosity
– – Realistic diffuse reflection Realistic diffuse reflection – – Diffuse Diffuse-
indirect direct both
Thursday, April 1, 2010
6 Computer Graphics 15-462
Beyond Ray Tracing
Ray tracing ignores the diffuse component of incident illumination
–to achieve this component requires sending out rays from each surface point for the whole visible hemisphere
Even if you could compute such a massive problem there is a conceptual problem—loops:
–point A gets light from point B –point B also gets light from point A
Thursday, April 1, 2010
7 Computer Graphics 15-462
Doing it Right The real solution is to solve simultaneously for incoming and outgoing light at all surface points
this is a massive integral equation
Radiosity deals with the relatively easy case of purely diffuse scenes Or, you can sample many, many complete paths from light source to camera (photon mapping)
Thursday, April 1, 2010
incoming light
Thursday, April 1, 2010
7 Computer Graphics 15-462
Doing it Right The real solution is to solve simultaneously for incoming and outgoing light at all surface points
this is a massive integral equation
Radiosity deals with the relatively easy case of purely diffuse scenes Or, you can sample many, many complete paths from light source to camera (photon mapping)
Thursday, April 1, 2010
7 Computer Graphics 15-462
Doing it Right The real solution is to solve simultaneously for incoming and outgoing light at all surface points
this is a massive integral equation
Radiosity deals with the relatively easy case of purely diffuse scenes Or, you can sample many, many complete paths from light source to camera (photon mapping)
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 8 8
Specular interaction depends on viewer position Specular interaction depends on viewer position— — diffuse does not diffuse does not Result: The color seen at any point on any visible Result: The color seen at any point on any visible surface is independent of viewer position surface is independent of viewer position Radiosity produces a 3D model of surface patches Radiosity produces a 3D model of surface patches with colors assigned to each with colors assigned to each Can be rendered in OpenGL Can be rendered in OpenGL Useful for Useful for architectual architectual fly fly-
throughs. .
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 5 5
Review: Local vs. Global Illumination Review: Local vs. Global Illumination
Global illumination: Ray tracing Ray tracing
– – Realistic specular reflection/transmission Realistic specular reflection/transmission – – Simplified diffuse reflection* Simplified diffuse reflection*
Global illumination: Radiosity Radiosity
– – Realistic diffuse reflection Realistic diffuse reflection – – Diffuse Diffuse-
indirect direct both
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 5 5
Review: Local vs. Global Illumination Review: Local vs. Global Illumination
Global illumination: Ray tracing Ray tracing
– – Realistic specular reflection/transmission Realistic specular reflection/transmission – – Simplified diffuse reflection* Simplified diffuse reflection*
Global illumination: Radiosity Radiosity
– – Realistic diffuse reflection Realistic diffuse reflection – – Diffuse Diffuse-
indirect direct both
Thursday, April 1, 2010
11 Computer Graphics 15-462
http://www.autodesk.com/us/lightscape/examples/html/index.htm
Thursday, April 1, 2010
12 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
18 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
19 Computer Graphics 15-462
http://www.autodesk.com/us/lightscape/examples/html/index.htm
Thursday, April 1, 2010
11 Computer Graphics 15-462
http://www.autodesk.com/us/lightscape/examples/html/index.htm
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 24 24
A Brief Review/Introduction to Radiosity
The Radiosity Equation, Form Factors
Putting it all together, and Improving
More Realism: A digression, and Two
A digression, and Two-
Pass Rendering
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 5 5
Review: Local vs. Global Illumination Review: Local vs. Global Illumination
Global illumination: Ray tracing Ray tracing
– – Realistic specular reflection/transmission Realistic specular reflection/transmission – – Simplified diffuse reflection* Simplified diffuse reflection*
Global illumination: Radiosity Radiosity
– – Realistic diffuse reflection Realistic diffuse reflection – – Diffuse Diffuse-
indirect direct both
Thursday, April 1, 2010
Patch
Patch
Patch
Patch
Thursday, April 1, 2010
9 Computer Graphics 15-462
Simple scene with diffuse surfaces White wall should show effect of being near red wall Compute light reflected between each pair of patches
Thursday, April 1, 2010
9 Computer Graphics 15-462
Simple scene with diffuse surfaces White wall should show effect of being near red wall Compute light reflected between each pair of patches
Thursday, April 1, 2010
10 Computer Graphics 15-462
Closed environment (office, factory) Compute interaction between all patches (over which intensity is assumed to be constant) View independent Difficult to do specular highlights
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 21 21
Divide all surfaces into patches (squares are Divide all surfaces into patches (squares are typical). typical). Determine a set of linear equations to model Determine a set of linear equations to model inter inter-
reflection between all patches. Solve set of simultaneous equations. Solve set of simultaneous equations. Render using standard hardware. Render using standard hardware.
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 22 22
No participating media (no light interaction No participating media (no light interaction with air, fog, etc) with air, fog, etc) Opaque surfaces Opaque surfaces— —no transmission no transmission Radiosity Radiosity is constant across element is constant across element Colors (R, G, B) are independent Colors (R, G, B) are independent
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 23 23
Diffuse Diffuse-
directions directions Light radiating from a point on a surface is Light radiating from a point on a surface is independent of position on the surface independent of position on the surface— — constant constant “ “radiosity radiosity” ” across a single surface across a single surface
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 25 25
– P => Energy (light “intensity”) – A => Area
respect to A will yield P for the patch
patch’s intensity of light per unit area
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 26 26
Radiosity determined by the sum of the emitted and reflected energy: and reflected energy:
i identifies the patch whose radiosity is being identifies the patch whose radiosity is being determined determined j j identifies a single other patch identifies a single other patch E E is emitted energy (light sources) is emitted energy (light sources) R R is reflectance (how much incoming light is is reflectance (how much incoming light is reflected) reflected) F F is the form factor between two patches is the form factor between two patches
" #
j ji j j i i i i i
F A B R A E A B
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 27 27
Radiosity determined by the sum of the emitted and reflected energy: and reflected energy:
Outgoing energy = Emitted energy + Reflected energy Emitted energy + Reflected energy
" #
j ji j j i i i i i
F A B R A E A B
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 28 28
Fij
ij:
: Fraction of light leaving patch Fraction of light leaving patch i i arriving arriving at patch at patch j j
Determined by properties of i i and and j j: :
– – Shape Shape – – Distance Distance – – Orientation Orientation – – Occlusion by other patches Occlusion by other patches
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 29 29
x x and and y y are points in are points in i i and and j j respectively respectively r r is distance from is distance from x x to to y y Thetas are angles between patch normals and line Thetas are angles between patch normals and line between between x x and and y y v v( (x x, ,y y) is a visibility function ) is a visibility function Can points Can points x x and and y y see each other? see each other?
" "
#
i j
P x P y ij i
dydx y x v r F A ) , ( * ' cos cos
2
$ % %
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 30 30
Form factors are symmetric: Form factors are symmetric: Divide radiosity equation by Divide radiosity equation by A Ai
i
ji j ij i
# !
j ji j j i i i i i
F A B R A E A B
# ! # !
j ij j i i i j i ji j j i i i
F B R E B A F A B R E B /
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 31 31
Our new equation gives the radiosity ( Our new equation gives the radiosity (B B) of a ) of a single patch, so to specify the radiosity of all single patch, so to specify the radiosity of all n n patches we need patches we need n n radiosity equations, one for radiosity equations, one for each patch each patch Known values: Known values: E E (given), (given), R R (given), (given), F F (computable) (computable) Unknown: Unknown: B B n n equations, equations, n n unknowns unknowns
j ij j i i i
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 32 32
Restate as a matrix equation Restate as a matrix equation… …and solve and solve Each of our Each of our n n linear equations contains linear equations contains n n double integrals, one for each form factor. double integrals, one for each form factor.
! ! ! ! " # $ $ $ $ % & ' ! ! ! ! " # $ $ $ $ % & ! ! ! ! " # $ $ $ $ % & ( ( ( ( ( (
n n nn n n n n n n n
E E E B B B F R F R F R F R F R F R F R F R F R ... ... * 1 ... ... ... ... ... ... 1 ... 1
2 1 2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 33 33
Input Scene Geometry Meshing (division into patches)
Form Factor Calculations
Input Reflectance/Emission Factors
Solve Radiosity Equation
Input Viewing Conditions
Rendering/Visualization Output Image
Texture Geometry with Radiosity Solution
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 34 34
Form factors depend only on scene Form factors depend only on scene
Solution of the radiosity system is Solution of the radiosity system is independent of viewing conditions, so if independent of viewing conditions, so if
needs to be solved once needs to be solved once— —can walk can walk around the scene in real around the scene in real-
time after it’ ’s s initially generated initially generated
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 35 35
Form factors are complicated. Full numeric Form factors are complicated. Full numeric approximation of these is expensive approximation of these is expensive— —many many special cases may be solved analytically. special cases may be solved analytically. Because we assume that radiosity is constant Because we assume that radiosity is constant across a patch, two patches are typically across a patch, two patches are typically assumed to be fully inter assumed to be fully inter-
visible or not at all inter inter-
be small enough to resolve shadows and other be small enough to resolve shadows and other complexities complexities
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 36 36
Two basic methods, both of which have Two basic methods, both of which have aliasing problems: aliasing problems:
Raycasting (typically slow) Raycasting (typically slow) Hemicube method (z Hemicube method (z-
buffer exploit)
Anti Anti-
aliasing may be performed in both cases
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 37 37
Render the entire scene from Render the entire scene from the perspective of the the perspective of the center of the current patch center of the current patch Rather than color, store patch Rather than color, store patch identifiers, using the z identifiers, using the z-
buffer to determine visibility Takes advantage of graphics Takes advantage of graphics hardware hardware
Thursday, April 1, 2010
http://www.siggraph.org/education/materials/HyperGraph/radiosity/overview_2.htm
Thursday, April 1, 2010
http://en.wikipedia.org/wiki/File:Hemicube_Unfold.gif
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 38 38
A Brief Review/Introduction to Radiosity
The Radiosity Equation, Form Factors
Putting it all together, and Improving
More Realism: A digression, and Two
A digression, and Two-
Pass Rendering
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 39 39
Divide all surfaces into patches.
Calculate form factors between all patches.
– – Lighting and viewer independent Lighting and viewer independent
Solve the radiosity equation.
– – Viewer independent Viewer independent
Render using standard 3D hardware.
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 33 33
Input Scene Geometry Meshing (division into patches)
Form Factor Calculations
Input Reflectance/Emission Factors
Solve Radiosity Equation
Input Viewing Conditions
Rendering/Visualization Output Image
Texture Geometry with Radiosity Solution
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 41 41
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 42 42
What is right? What is wrong?
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 43 43
Inter Inter-
reflection effects— —clearly visible clearly visible between the box on the right and the wall between the box on the right and the wall
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 44 44
Blocky Blocky-
looking— —patch boundaries extremely patch boundaries extremely
Causes of blockiness Causes of blockiness
Aliasing in hemicube method causes significant Aliasing in hemicube method causes significant differences in radiosity between adjacent differences in radiosity between adjacent patches patches Large Large patch size patch size
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 45 45
Use antialiasing to clean up hemicube Use antialiasing to clean up hemicube method method Interpolation Interpolation
Determine radiosity at each vertex of a patch Determine radiosity at each vertex of a patch and use bilinear interpolation to make things and use bilinear interpolation to make things look smoother look smoother
Increase patch resolution (decrease size) Increase patch resolution (decrease size)
Expensive if done uniformly Expensive if done uniformly – – O( O(n n2
2)
) How can we do this intelligently? How can we do this intelligently?
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 46 46
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 47 47
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 48 48
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 49 49
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 50 50
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 51 51
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 52 52
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 53 53
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 54 54
Introduce a patch substructure Introduce a patch substructure— —divide each divide each patch into smaller patch into smaller elements elements. . Keep distinction between patches and Keep distinction between patches and elements in order to avoid efficiency elements in order to avoid efficiency problems problems
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 55 55
Determine light transport one Determine light transport one-
way from patches onto elements, not analyzing , not analyzing element element-
to-
element interaction O( O(mn mn) for ) for m m elements and elements and n n patches. More
expensive than the original expensive than the original n n2
2 approach,
approach, since since m m >> >> n n, but much better than O( , but much better than O(m m2
2).
).
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 56 56
Subdivide elements adaptively: Subdivide elements adaptively: Begin with elements identical to patches. Begin with elements identical to patches. Determine radiosity of an element, then compare to Determine radiosity of an element, then compare to neighbors to obtain an error value. If within some error neighbors to obtain an error value. If within some error threshold, assign constant radiosity (or optionally threshold, assign constant radiosity (or optionally interpolate). interpolate). Otherwise, subdivide the element and recurse until the Otherwise, subdivide the element and recurse until the error threshold or a minimum element size is reached. error threshold or a minimum element size is reached.
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 57 57
Results in very smooth Results in very smooth-
looking results for a relatively small amount of extra work relatively small amount of extra work Shadows, areas near lights, and edges in Shadows, areas near lights, and edges in general look much better general look much better Not an idea specific to radiosity! Adaptive Not an idea specific to radiosity! Adaptive subdivision is a general tool used in many subdivision is a general tool used in many areas of graphics and other fields as well areas of graphics and other fields as well
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 58 58
http://www.acm.org/jgt/papers/TeleaVanOverveld97/
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 59 59
http://aig.cs.man.ac.uk/gallery/vrad.html
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 60 60
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 61 61
A Brief Review/Introduction to Radiosity
The Radiosity Equation, Form Factors
Putting it all together, and Improving
More Realism
Thursday, April 1, 2010
11 Computer Graphics 15-462
http://www.autodesk.com/us/lightscape/examples/html/index.htm
Thursday, April 1, 2010
Thursday, April 1, 2010
14 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
15 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
16 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
17 Computer Graphics 15-462
http://www.povray.org/
Thursday, April 1, 2010
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 62 62
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 63 63
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 64 64
Keep viewer independence Keep viewer independence Light reflected differently in different directions Light reflected differently in different directions Calculations for each source and each Calculations for each source and each direction direction Impractical Impractical
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 65 65
Combine radiosity and raytracing Combine radiosity and raytracing Goal: Represent four forms of light Goal: Represent four forms of light transport: transport:
– – Diffuse Diffuse -
> Diffuse – – Diffuse Diffuse -
> Specular – – Specular Specular -
> Diffuse – – Specular Specular -
> Specular
Two Two-
pass approach, one for each method
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 66 66
Diffuse Diffuse -
> Diffuse
Normal diffuse reflection model Normal diffuse reflection model Diffuse transmission (translucent objects) Diffuse transmission (translucent objects) – – requires requires modified form factor modified form factor
Specular Specular -
> Diffuse
Specular transmission (transparent objects, e.g. Specular transmission (transparent objects, e.g. windows) windows) – – involves extended form factor involves extended form factor Specular reflection (reflective objects, e.g. mirrors) Specular reflection (reflective objects, e.g. mirrors) – – create actual create actual “ “mirror image mirror image” ” environment with copies environment with copies
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 67 67
Only accounts for a single specular reflection (try creating reflection (try creating “ “mirror image mirror image” ” environments for two mirrors facing each environments for two mirrors facing each
Accurate diffuse model
Equations solved as in the classical method method
Still viewer-
independent
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 68 68
Specular -
> Specular
– – Reflection and transmission as in classical Reflection and transmission as in classical method method
Diffuse -
> Specular
– – Use the radiosity calculated in the first pass Use the radiosity calculated in the first pass – – Integrate incoming light over a hemisphere (or Integrate incoming light over a hemisphere (or hemicube), or approximate with a tiny frustum hemicube), or approximate with a tiny frustum in the direction of reflection in the direction of reflection – – Recurse if visible surface is specular Recurse if visible surface is specular
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 69 69
http://www.cg.tuwien.ac.at/research/rendering/rays-radio/
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 70 70
(radiosity info. not yet used, just raytracing) (radiosity info. not yet used, just raytracing)
http://www.cg.tuwien.ac.at/research/rendering/rays-radio/
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 71 71
http://www.cg.tuwien.ac.at/research/rendering/rays-radio/
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 72 72
Very expensive. Takes the cost of radiosity Very expensive. Takes the cost of radiosity added to the cost of raytracing and then added to the cost of raytracing and then throws even more calculations into the mix throws even more calculations into the mix Many approximations remain, particularly in Many approximations remain, particularly in specular specular -
> diffuse and diffuse -
> specular transport transport
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 73 73
Produces very convincing effects and works Produces very convincing effects and works very well for scenes with small numbers of very well for scenes with small numbers of reflecting/transmitting objects reflecting/transmitting objects Used in combination with other methods for Used in combination with other methods for extremely high extremely high-
quality images
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 74 74
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 75 75
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 76 76
Divide all surfaces into patches. Divide all surfaces into patches. Calculate form factors between all patches. Calculate form factors between all patches.
Lighting and viewer independent Lighting and viewer independent
Solve the radiosity equation Solve the radiosity equation
Viewer independent Viewer independent
Render using standard 3D hardware. Render using standard 3D hardware.
Thursday, April 1, 2010
15 15-
462 Computer Graphics I 77 77
Demo that explores resolution and other parameters parameters
– – http://www.mvpny.com/RadTutMV/RadiosityTut1 http://www.mvpny.com/RadTutMV/RadiosityTut1 MV.html MV.html
(many great radiosity resources)
– – http:// http://www.scs.leeds.ac.uk/cuddles/rover/main.htm www.scs.leeds.ac.uk/cuddles/rover/main.htm
Cornell graphics group (many pretty pictures)
(many pretty pictures) – – http:// http://www.graphics.cornell.edu www.graphics.cornell.edu/online/research /online/research/ /
Thursday, April 1, 2010