Last Time? Local vs. Global Illumination & Radiosity
An early application of radiative heat transfer in stables. CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Today BRDF • Local Illumination • Ratio of light coming from one direction – BRDF that gets reflected in another direction – Ideal Diffuse Reflectance – Ideal Specular Reflectance • Bidirectional Reflectance – The Phong Model Distribution Function • Why is Global Illumination Important? –4D • The Rendering Equation φ φ –R(θi , i ; θo, o) • Radiosity Equation/Matrix • Calculating the Form Factors • Advanced Radiosity
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Incoming radiance Ideal Diffuse Reflectance
• The amount of light received by a • Assume surface reflects equally in surface depends on incoming angle all directions (a.k.a. Lambertian) – Bigger at normal incidence • An ideal diffuse surface is, at the microscopic level, (Winter/Summer difference) n l a very rough surface • By how much? • Examples: chalk, θ dB Surface – dB = dA cos θ clay, some paints – Same as: l . n (dot product with normal) dA Surface
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
1 Ideal Specular Reflectance Non-Ideal Reflectors
• Assume surface reflects n • Real materials tend to deviate significantly from only in mirror direction θ θ ideal mirror reflectors – View dependent r l • Highlight is blurry • Microscopic surface elements are oriented in Surface • They are not ideal diffuse surfaces either … the same direction as the surface • Examples: mirrors, highly polished metals
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Non-Ideal Reflectors The Phong Model
• Most light reflects in the ideal reflected direction • How much light is reflected “specularly”? • Microscopic surface variations will reflect light – Depends on the angle between the ideal reflection direction and the viewer direction α. just slightly offset n Camera L r • How much light is reflected? L = k (cosα)q i o s r 2 θ θ α l ks: specular reflection coefficient q : specular reflection exponent v Surface
Effect of the q exponent CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
The Phong Model Ambient Illumination
• Sum of three components: • Avoids the complexity of global illumination. diffuse reflection + specular reflection + “ambient”. • Represents the reflection of all indirect illumination. • This is a total hack!
ω = L( r ) ka Surface
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
2 Anisotropic BRDFs Questions?
• Surfaces with strongly oriented microgeometry • Examples: – brushed metals, hair, fur, cloth, velvet
Source: Westin et.al 92
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Today Why Global Illumination?
• Local Illumination • Simulate all light inter-reflections (indirect lighting) • Why is Global Illumination Important? – in a room, a lot of the light is indirect: it is reflected by walls. • How have we dealt with this so far? – The Cornell Box – Ambient term to fake some uniform indirect light – Radiosity vs. Ray Tracing • The Rendering Equation • Radiosity Equation/Matrix • Calculating the Form Factors • Advanced Radiosity
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Why Radiosity? Radiosity vs. Ray Tracing
• Sculpture by John Ferren • Diffuse panels photograph:
Original sculpture by Ray traced image. A standard Image rendered with radiosity. diagram John Ferren lit by ray tracer cannot simulate the note color bleeding effects. daylight from behind. interreflection of light between from above: diffuse surfaces.
CSCI-6962 Advanced Computer Graphicseye Cutler CSCI-6962 Advanced Computer Graphics Cutler
3 The Cornell Box The Cornell Box
photograph direct illumination 1 bounce 2 bounces (0 bounces)
images by Micheal Callahan Goral, Torrance, Greenberg & Battaile http://www.cs.utah.edu/~shirley/classes/cs684_98/students/callahan/bounce/ Modeling the Interaction of Light Between Diffuse Surfaces CSCI-6962 Advanced Computer Graphics Cutler simulation CSCI-6962 Advanced Computer GraphicsSIGGRAPH Cutler '84
The Cornell Box Two approaches for global illumination
• Careful calibration and measurement allows for • Radiosity comparison between physical scene & simulation – View-independent – Diffuse only • Monte-Carlo Ray-tracing – Send tons of indirect rays
photograph simulation Light Measurement Laboratory
Cornell University,CSCI-6962 Advanced Program Computer for Graphics Computer Cutler Graphics CSCI-6962 Advanced Computer Graphics Cutler
Radiosity vs. Ray Tracing Questions?
• Ray tracing is an image-space algorithm – If the camera is moved, we have to start over • Radiosity is computed in object-space – View-independent (just don't move the light) – Can pre-compute complex lighting to allow interactive walkthroughs
CSCI-6962 Advanced Computer Graphics Cutler LightscapeCSCI-6962 http://www.lightscape.comAdvanced Computer Graphics Cutler
4 Today The Rendering Equation
• Local Illumination • Why is Global Illumination Important? ω' • The Rendering Equation • Radiosity Equation/Matrix x' • Calculating the Form Factors L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA • Advanced Radiosity
L (x',ω') is the radiance from a point on a surface in a given direction ω'
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
The Rendering Equation The Rendering Equation
ω' ω'
x' x'
L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA
E(x',ω') is the emitted radiance Sum the contribution from all of from a point: E is non-zero only the other surfaces in the scene if x' is emissive (a light source) CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
The Rendering Equation The Rendering Equation
ω' x ω' x ω ω
x' x'
L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA
For each x, compute L(x, ω), the radiance scale the contribution by at point x in the direction ω (from x to x') ρx'(ω,ω'), the reflectivity (BRDF) of the surface at x'
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
5 The Rendering Equation The Rendering Equation
ω' x ω' x ω ω
x' x'
L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA For each x, compute V(x,x'), the visibility between x and x': For each x, compute G(x, x'), which 1 when the surfaces are unobstructed describes the on the geometric relationship along the direction ω, 0 otherwise between the two surfaces at x and x’ CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Intuition about G(x,x')? Questions?
• Which arrangement of two surfaces will yield the greatest transfer of light energy? Why?
Museum simulation. Program of Computer Graphics, Cornell University. CSCI-6962 Advanced Computer Graphics Cutler 50,000CSCI-6962 patches. Advanced Note indirectComputer lightingGraphics from Cutler ceiling.
Today Radiosity Overview
• Local Illumination • Surfaces are assumed to be perfectly Lambertian (diffuse) • Why is Global Illumination Important? – reflect incident light in all • The Rendering Equation directions with equal intensity • The scene is divided into a set • Radiosity Equation/Matrix of small areas, or patches.
• Calculating the Form Factors • The radiosity, Bi, of patch i is • Advanced Radiosity the total rate of energy leaving a surface. The radiosity over a patch is constant. ω' • Units for radiosity: Watts / steradian * meter2 x'
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
6 Radiosity Equation Continuous Radiosity Equation
L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA reflectivity Radiosity assumption: x perfectly diffuse surfaces (not directional) Bx' = Ex' + ρx' ∫ G(x,x') V(x,x') Bx
Bx' = Ex' + ρx' ∫ Bx G(x,x')V(x,x') form factor
G: geometry term V: visibility term
No analytical solution, x’ even for simple configurations
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Discrete Radiosity Equation The Radiosity Matrix
Discretize the scene into n patches, over which the radiosity is constant n = + ρ Bi Ei i ∑ Fij B j reflectivity j=1
n n simultaneous equations with n unknown Bi values can be written Aj = + ρ Bi Ei i ∑ Fij B j in matrix form: j=1 −−ρρ − ρ ⎡1 111FF 112L 11 Fn ⎤ ⎡⎤B1 ⎡ E1 ⎤ ⎢ −−ρρFF1 ⎥ ⎢⎥B ⎢E ⎥ form factor ⎢ 221 222 ⎥ ⎢⎥2 = ⎢ 2 ⎥ ⎢ MO⎥ ⎢⎥M ⎢ M ⎥ ⎢ −−ρρ⎥ ⎢⎥ ⎢ ⎥ • discrete representation ⎣⎢ nnFF1 LL1 nnn⎦⎥ ⎣⎦⎢⎥Bn ⎣⎢En ⎦⎥ • iterative solution A solution yields a single radiosity value B for each patch in the Ai • costly geometric/visibility i calculations environment, a view-independent solution.
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Solving the Radiosity Matrix Computing Vertex Radiosities
The radiosity of a single patch i is updated for each iteration by •Bi radiosity values are gathering radiosities from all other patches: constant over the extent of a patch. • How are they mapped to the vertex radiosities (intensities) needed by the renderer? – Average the radiosities of patches that contribute to the vertex – Vertices on the edge of a surface are assigned values extrapolation This method is fundamentally a Gauss-Seidel relaxation
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
7 Questions? Today
• Local Illumination • Why is Global Illumination Important? • The Rendering Equation • Radiosity Equation/Matrix • Calculating the Form Factors • Advanced Radiosity
Factory simulation. Program of Computer Graphics, Cornell University. CSCI-6962 Advanced30,000 Computer patches. Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Calculating the Form Factor Fij Calculating the Form Factor Fij •F= fraction of light energy leaving patch j that arrives at patch i •Fij = fraction of light energy leaving patch j ij that arrives at patch i patch j • Takes account of both: θ – geometry (size, orientation & position) j r – visibility (are there any occluders?) θ i patch j
patch j patch j patch i θ θ 1 cos i cos j Fij = ∫∫ 2 Vij dAj dAi patch i patch i patch i Ai Ai Aj π r
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Form Factor Determination Hemicube Algorithm
The Nusselt analog: the form factor of a patch is equivalent to the fraction of the • A hemicube is constructed around the center of each patch the unit circle that is formed by taking the projection of the patch onto the hemisphere surface and projecting it down onto the circle. • Faces of the hemicube are divided into "pixels" A • Each patch is projected (rasterized) onto the faces j of the hemicube • Each pixel stores its pre-computed form factor Aj The form factor for a particular patch is just the sum of the pixels it overlaps dAi r = 1 F • Patch occlusions are dAi,Aj handled similar to z-buffer rasterization
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
8 Form Factor from Ray Casting Questions?
•Cast n rays between the two patches – n is typically between 4 and 32 – Compute visibility – Integrate the point-to-point form factor
• Permits the computation Aj of the patch-to-patch form factor, as opposed to point-to-patch Ai
CSCI-6962 Advanced Computer Graphics Cutler LightscapeCSCI-6962 http://www.lightscape.comAdvanced Computer Graphics Cutler
Today Stages in a Radiosity Solution
• Local Illumination Input Form Factor Why so costly? Geometry Calculation > 90% • Why is Global Illumination Important? Calculation & storage of • The Rendering Equation Reflectance n2 form factors Properties Solve the • Radiosity Equation/Matrix Radiosity Matrix < 10% • Calculating the Form Factors • Advanced Radiosity Radiosity Solution – Progressive Radiosity Camera Position & – Adaptive Subdivision Visualization Orientation (Rendering) ~ 0% – Discontinuity Meshing – Hierarchical Radiosity Radiosity Image
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Progressive Refinement Reordering the Solution for PR
• Goal: Provide frequent and Shooting: the radiosity of all patches is updated for each iteration: timely updates to the user during computation BBρ F • Key Idea: Update the entire ⎡⎤⎡⎤⎡11LL 11i ⎤⎡⎤ ⎢⎥⎢⎥⎢BBρ F ⎥⎢⎥ image at every iteration, rather ⎢⎥⎢⎥⎢22L 22i ⎥⎢⎥ ⎢⎥⎢⎥⎢M M ⎥⎢⎥M than a single patch ⎢⎥⎢⎥⎢=+ ⎥⎢⎥ B • How? Instead of summing the ⎢⎥⎢⎥⎢ ⎥⎢⎥i ⎢⎥⎢⎥⎢M M ⎥⎢⎥M light received by one patch, ⎢⎥⎢⎥⎢ρ ⎥⎢⎥ ⎣⎦⎣⎦⎣⎢⎥⎢⎥⎢BBnn nni F ⎦⎥⎣⎦⎢⎥ distribute the radiance of the LL patch with the most undistributed radiance. This method is fundamentally a Southwell relaxation
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
9 Progressive Refinement w/out Ambient Term Progressive Refinement with Ambient Term
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Questions? Today • Local Illumination • Why is Global Illumination Important? • The Rendering Equation • Radiosity Equation/Matrix • Calculating the Form Factors • Advanced Radiosity – Progressive Radiosity – Adaptive Subdivision – Discontinuity Meshing – Hierarchical Radiosity
LightscapeCSCI-6962 http://www.lightscape.comAdvanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Increasing the Accuracy of the Solution Adaptive Subdivision of Patches
What’s wrong with this picture? • Image quality is a function of patch size • Compute a solution on a uniform initial mesh, then refine the mesh in areas that exceed some error tolerance: – shadow boundaries – other areas with a high radiosity gradient Coarse patch solution Improved solution Adaptive subdivision (145 patches) (1021 subpatches) (1306 subpatches)
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
10 Discontinuity Meshing Discontinuity Meshing
• Limits of umbra and penumbra source – Captures nice shadow boundaries – Complex geometric computation to blocker construct mesh
umbra “Fast and Accurate Hierarchical penumbra Radiosity Using Global Visibility” Durand, Drettakis, & Puech 1999
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Hierarchical Radiosity Practical Problems with Radiosity • Group elements when the light exchange is not important • Meshing – Breaks the quadratic complexity – memory – Control non trivial, memory cost – robustness
• Form factors – computation
Cow-cow form factor? • Diffuse limitation – extension to specular takes too much memory
CSCI-6962 Advanced Computer Graphics Cutler CSCI-6962 Advanced Computer Graphics Cutler
Questions?
LightscapeCSCI-6962 http://www.lightscape.comAdvanced Computer Graphics Cutler
11