Global Illumnaton and Radosty CS535 Danel G. Alaga Department of Computer Scence Purdue Unversty
Recall: Lghtng and Shadng Lght sources Pont lght Models an omndrectonal lght source (e.g., a bulb) Drectonal lght Models an omndrectonal lght source at nfnty Spot lght Models a pont lght wth drecton Lght model Ambent lght Dffuse reflecton Specular reflecton
Recall: Lghtng and Shadng Dffuse reflecton Lambertan model
Recall: Lghtng and Shadng Specular reflecton Phong model
Recall: Lghtng and Shadng Well.there s much more
For example Reflecton -> Bdrectonal Reflectance Dstrbuton Functons (BRDF) Dffuse, Specular -> Dffuse Interreflecton, Specular Interreflecton Color bleedng Transparency, Refracton Scatterng Subsurface scatterng Through partcpatng meda And more!
Illumnaton Models So far, you consdered mostly local (drect) llumnaton Lght drectly from lght sources to surface No shadows (actually s a global effect) Global (ndrect) llumnaton: multple bounces of lght Hard and soft shadows Reflectons/refractons (you knda saw already) Dffuse and specular nterreflectons
Welcome to Global Illumnaton Drect llumnaton + ndrect llumnaton; e.g. Drect = reflectons, refractons, shadows, Indrect = dffuse and specular nter-reflecton, wth global llumnaton only dffuse nter-reflecton drect llumnaton
Global Illumnaton Drect llumnaton + ndrect llumnaton; e.g. Drect = reflectons, refractons, shadows, Indrect = dffuse and specular nter-reflecton,
Reflectance Equaton x r L ( x, ) L ( x, ) L ( x, ) f ( x,, )( n) r r e r r Reflected Lght Emsson Incdent BRDF Cosne of (Output Image) Lght (from Incdent angle [Sldes wth help from Pat Hanrahan and Henrk Jensen] lght source)
Reflectance Equaton x r Sum over all lght sources L ( x, ) L ( x, ) L ( x, ) f ( x,, )( n) r r e r r Reflected Lght Emsson Incdent BRDF (Output Image) Lght (from lght source) Cosne of Incdent angle
Reflectance Equaton d x r L ( x, ) L ( x, ) L ( x, ) f( x,, ) cos d r r e r r Reflected Lght (Output Image) Emsson Replace sum wth ntegral Incdent Lght (from lght source) BRDF Cosne of Incdent angle
Reflectance Equaton d x r L ( x, ) L ( x, ) L ( x, ) f( x,, ) cos d r r e r r
The Challenge L ( x, ) L ( x, ) L ( x, ) f ( x,, ) cos d r r e r r Computng reflectance equaton requres knowng the ncomng radance from surfaces But determnng ncomng radance requres knowng the reflected radance from surfaces
Surfaces (nterreflecton) x da Global Illumnaton d x r Lr ( x, r ) Le ( x, r ) Lr ( x, ) f ( x,, r ) cosd Reflected Lght (Output Image) Emsson Reflected Lght (from prev surface) BRDF Cosne of Incdent angle
Renderng Equaton Surfaces (nterreflecton) x da d x r Lr ( x, r ) Le ( x, r ) Lr ( x, ) f ( x,, r ) cosd Reflected Lght (Output Image) UNKNOWN Emsson Reflected BRDF Cosne of Lght Incdent angle KNOWN UNKNOWN KNOWN KNOWN
Renderng Equaton (Kajya 1986)
Renderng Equaton as Integral Equaton Lr ( x, r ) Le ( x, r ) Lr ( x, ) f ( x,, r ) cosd Reflected Lght (Output Image) UNKNOWN Emsson Reflected BRDF Cosne of Lght Incdent angle KNOWN UNKNOWN KNOWN KNOWN Is a Fredholm Integral Equaton of second knd [extensvely studed numercally] wth canoncal form lu ( ) e( u) lv ( ) K( u, v ) dv Kernel of equaton
Lnear Operator Equaton lu ( ) e( u) lv ( ) K( u, v ) dv Kernel of equaton L EKL whch s effectvely a smple matrx equaton (or system of smultaneous lnear equatons) where L, E are vectors, K s the lght transport matrx (more on ths later!)
Solvng the Renderng Equaton (=how to compute L?) In general, too hard for analytc soluton But there are approxmatons and some nce observatons
Solvng the Renderng Equaton (=how to compute L?) L EKL IL KL E ( I K) L E L ( I K) 1 E (usng Bnomal Theorem) 2 3 L ( I K K K...) E 2 3 L E KE K E K E... where term n corresponds to n-th bounces of lght
Ray Tracng 2 3 L E KE K E K E... Emsson drectly From lght sources Drect Illumnaton on surfaces Global Illumnaton (One bounce ndrect) [Mrrors, Refracton] (Two bounce ndrect) [Caustcs, etc ]
Ray Tracng 2 3 L E KE KEKE... Emsson drectly From lght sources OpenGL Shadng Drect Illumnaton on surfaces Global Illumnaton (One bounce ndrect) [Mrrors, Refracton] (Two bounce ndrect) [Caustcs, etc ]
Radosty Radosty, nspred by deas from heat transfer, s an applcaton of a fnte element method to solvng the renderng equaton for scenes wth purely dffuse surfaces (renderng equaton) [Radosty sldes heavly based on Dr. Maro Costa Sousa, Dept. of of CS, U. Of Calgary]
Radosty Calculatng the overall lght propagaton wthn a scene, for short global llumnaton s a very dffcult problem. Wth a standard ray tracng algorthm, ths s a very tme consumng task, snce a huge number of rays have to be shot.
Radosty For ths reason, the radosty method was nvented. The man dea of the method s to store llumnaton values on the surfaces of the objects, as the lght s propagated startng at the lght sources.
Equaton: Radosty
Ray Tracng
Radosty
Dffuse Interreflecton (radosty method)
Radosty (Thermal Heat Transfer) The "radosty" method has ts bass n the feld of thermal heat transfer. Heat transfer theory descrbes radaton as the transfer of energy from a surface when that surface has been thermally excted.
Radosty (Computer Graphcs) Assumpton #1: surfaces are dffuse emtters and reflectors of energy, emttng and reflectng energy unformly over ther entre area. Assumpton #2: an equlbrum soluton can be reached; that all of the energy n an envronment s accounted for, through absorpton and reflecton. Also vewpont ndependent: the soluton wll be the same regardless of the vewpont of the mage.
The Radosty Equaton The "radosty equaton" descrbes the amount of energy whch can be emtted from a surface, as the sum of the energy nherent n the surface (a lght source, for example) and the energy whch strkes the surface, beng emtted from some other surface. The energy whch leaves a surface (surface "j") and strkes another surface (surface "") s attenuated by two factors: the "form factor" between surfaces "" and "j", whch accounts for the physcal relatonshp between the two surfaces the reflectvty of surface ", whch wll absorb a certan percentage of lght energy whch strkes the surface.
The Radosty Equaton B E B j F j Radosty of surface Emssvty of surface Radosty of surface j Form Factor of surface j relatve to surface Reflectvty of surface wll absorb a certan percentage of lght energy whch strkes the surface Surface Surface j accounts for the physcal relatonshp between the two surfaces
The Radosty Equaton B E B j F j Energy emtted by surface Surface j Surface
The Radosty Equaton B E B j F j Energy reachng surface from other surfaces Surface j Surface
The Radosty Equaton B E B j F j Energy reflected by surface Surface j Surface
Classc Radosty Algorthm Mesh Surfaces nto Elements Compute Form Factors Between Elements Solve Lnear System for Radostes Reconstruct and Dsplay Soluton
Classc Radosty Algorthm Mesh Surfaces nto Elements Compute Form Factors Between Elements Solve Lnear System for Radostes Reconstruct and Dsplay Soluton
The Form Factor: The fracton of energy leavng one surface that reaches another surface It s a purely geometrc relatonshp, ndependent of vewpont or surface attrbutes Surface j Surface
Between dfferental areas, the form factor equals: dfferental area of surface, j angle between Normal and r angle between Normal j and r FdA da j cos cos r 2 j Surface j j da j r vector from da to da j da Surface
Between dfferental areas, the form factor equals: The overall form factor between and j s found by ntegratng FdA da j j cos cos r 2 j F j 1 A 2 A A j cos cos r j da da j Surface j j da j r da Surface
Next Step: Learn ways of computng form factors Recall the Radosty Equaton: B E B j F j The F j are the form factors Form factors ndependent of radostes (depend only on scene geometry)
Form Factors n (More) Detal F j 1 2 A A A j cos cos r j da da j F j 1 A 2 A A j cos cos r j V j da da j where V j s the vsblty (0 or 1)
Form Factors n (More) Detal Several ways to fnd form factors Hemcube was orgnal method + Hardware acceleraton + Gves F daaj for all j n one pass - Alasng Area samplng methods now preferred Slower than hemcube but GPU-able As accurate as desred snce adaptve
Area Samplng Subdvde A j nto small peces da j For all da j cast ray daj-daj to determne V j f vsble compute F dadaj cos cos j FdAdA V j 2 r sum up F daaj += F dadaj j da j da ray da j A j We have now F daaj
Next We have the form factors How do we fnd the radosty soluton for the scene? The "Full Matrx" Radosty Algorthm Gatherng & Shootng Progressve Radosty Meshng
Radosty Matrx n j j j B F E B 1 n n nn n n n n n n n E E E B B B F F F F F F F F F 2 1 2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 1 1 1 n j j j E B F B 1 E B
Radosty Matrx The "full matrx" radosty soluton calculates the form factors between each par of surfaces n the envronment, then forms a seres of smultaneous lnear equatons. Ths matrx equaton s solved for the "B" values, whch can be used as the fnal ntensty (or color) value of each surface. n n nn n n n n n n n E E E B B B F F F F F F F F F 2 1 2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 1 1 1
Radosty Matrx Ths method produces a complete soluton, at the substantal cost of frst calculatng form factors between each par of surfaces and then the soluton of the matrx equaton. Ths leads to substantal costs not only n computaton tme but n storage.
Next We have the form factors How do we fnd the radosty soluton for the scene? The "Full Matrx" Radosty Algorthm Gatherng & Shootng Progressve Radosty Meshng
Drect methods: O(n 3 ) Solve [F][B] = [E] Gaussan elmnaton Goral, Torrance, Greenberg, Battale, 1984 Iteratve methods: O(n 2 ) Energy conservaton dagonally domnant teraton converges Gauss-Sedel, Jacob: Gatherng Nshta, Nakamae, 1985 Cohen, Greenberg, 1985 Southwell: Shootng Cohen, Chen, Wallace, Greenberg, 1988
Gatherng In a sense, the lght leavng patch s determned by gatherng n the lght from the rest of the envronment B B due E to B j n j1 B j F B j j F j B E n Fj j1 B j
Gatherng Gatherng lght through a hem-cube allows one patch radosty to be updated. B E n Fj j1 B j
Gatherng
Successve Approxmaton
Shootng Shootng lght through a sngle hem-cube allows the whole envronment's radosty values to be updated smultaneously. For all j B j B j B E j j where F j F j A A j
Shootng
Progressve Radosty
Next We have the form factors How do we fnd the radosty soluton for the scene? The "Full Matrx" Radosty Algorthm Gatherng & Shootng Progressve Radosty Meshng
Accuracy
Artfacts
Increasng Resoluton
Adaptve Meshng
Some Radosty Results
The Cornell Box Ths s the orgnal Cornell box, as smulated by Cndy M. Goral, Kenneth E. Torrance, and Donald P. Greenberg for the 1984 paper Modelng the nteracton of Lght Between Dffuse Surfaces, Computer Graphcs (SIGGRAPH '84 Proceedngs), Vol. 18, No. 3, July 1984, pp. 213-222. Because form factors were computed analytcally, no occludng objects were ncluded nsde the box.
The Cornell Box Ths smulaton of the Cornell box was done by Mchael F. Cohen and Donald P. Greenberg for the 1985 paper The Hem-Cube, A Radosty Soluton for Complex Envronments, Vol. 19, No. 3, July 1985, pp. 31-40. The hem-cube allowed form factors to be calculated usng scan converson algorthms (whch were avalable n hardware), and made t possble to calculate shadows from occludng objects.
Dscontnuty Meshng Dan Lschnsk, Flppo Tamper and Donald P. Greenberg created ths mage for the 1992 paper Dscontnuty Meshng for Accurate Radosty. It depcts a scene that represents a pathologcal case for tradtonal radosty mages, many small shadow castng detals. Notce, n partcular, the shadows cast by the wndows, and the slats n the char.
Opera Lghtng Ths scene from La Boheme demonstrates the use of focused lghtng and angular projecton of predstorted mages for the background. It was rendered by Jule O'B. Dorsey, Francos X. Sllon, and Donald P. Greenberg for the 1991 paper Desgn and Smulaton of Opera Lghtng and Projecton Effects.
Radosty Factory These two mages were rendered by Mchael F. Cohen, Shenchang Erc Chen, John R. Wallace and Donald P. Greenberg for the 1988 paper A Progressve Refnement Approach to Fast Radosty Image Generaton. The factory model contans 30,000 patches, and was the most complex radosty soluton computed at that tme. The radosty soluton took approxmately 5 hours for 2,000 shots, and the mage generaton requred 190 hours; each on a VAX8700.
Museum Most of the llumnaton that comes nto ths smulated museum arrves va the baffles on the celng. As the progressve radosty soluton executed, users could wtness each of the baffles beng llumnated from above, and then reflectng some of ths lght to the bottom of an adjacent baffle. A porton of ths reflected lght was eventually bounced down nto the room. The mage appeared on the proceedngs cover of SIGGRAPH 1988.