Advanced Computer Graphcs (Fall 2009 CS 283, Lecture 13: Recent Advances n Monte Carlo Offlne Renderng Rav Ramamoorth http://nst.eecs.berkeley.edu/~cs283/fa10 Dscusson Problems dfferent over years. Intally, how to make renderng a sngle pcture fast. Now, multdmensonal effects, multple mages. Include mage-based lghtng, reflectance. Monte Carlo tself s a well known numercal method. But, many recent nsghts, more to come Lecture surveys much work n last decade at hgh-level. Need to read papers for more depth. Some sldes/deas courtesy Pat Hanrahan, Henrk Jensen Hstory and Outlne Is Monte Carlo Renderng solved? Can t be made more effcent (90s: Irradance cachng takes advantage of coherence Correct samplng: Stratfed, Multple Importance, Bdrectonal path tracng, Metropols Photon Mappng Work wth Image-Based Appearance (02-06 Importance samplng envronment maps, BRDFs Multdmensonal effects (depth-of feld, soft shadows, moton blur Adaptve multdmensonal samplng Cut-based herarchcal ntegraton Frequency space analyss Smoothness of Indrect Lghtng Drect Indrect Drect + Indrect Irradance Cachng Irradance Calculaton Emprcally, (dffuse nterreflectons low frequency Therefore, should be able to sample sparsely Irradance cachng samples rradance at few ponts on surfaces, and then nterpolates Ward, Rubnsten, Clear. SIGGRAPH 88, A ray tracng soluton for dffuse nterreflecton L ( x, w Ex ( = ò L ( x, wcosq dw Ex ( = å å wx ( E( x wx ( 1 wx ( = e( x poston rotaton Dervaton n Ward paper 1
Algorthm Outlne Fnd all samples wth w(x > q f ( samples found nterpolate else compute new rradance N.B. Subsample the mage frst and then fll n Irradance Cachng Example Fnal Image Sample Locatons Hstory and Outlne Is Monte Carlo Renderng solved? Can t be made more effcent (90s: Irradance cachng takes advantage of coherence Correct samplng: Stratfed, Multple Importance, Bdrectonal path tracng, Metropols Photon Mappng Work wth Image-Based Appearance (02-06 Importance samplng envronment maps, BRDFs Multdmensonal effects (depth-of feld, soft shadows, moton blur Adaptve multdmensonal samplng Cut-based herarchcal ntegraton Frequency space analyss Better Samplng Smarter ways to Monte Carlo sample Long hstory: Stratfed, Importance, B- Drectonal, Multple Importance, Metropols Good reference s Veach thess We only brefly dscuss a couple of strateges Comparson of smple patterns Latn Hypercube Quas Monte Carlo Ground Truth Unform Random Stratfed 16 samples for area lght, samples per pxel, total 6 samples D. Mtchell 95, Consequences of stratfed samplng n graphcs Fgures courtesy Tanyu Lu 2
Spectrally Optmal Samplng Mtchell 91 Hstory and Outlne Is Monte Carlo Renderng solved? Can t be made more effcent (90s: Irradance cachng takes advantage of coherence Correct samplng: Stratfed, Multple Importance, Bdrectonal path tracng, Metropols Photon Mappng Work wth Image-Based Appearance (02-06 Importance samplng envronment maps, BRDFs Multdmensonal effects (depth-of feld, soft shadows, moton blur Adaptve multdmensonal samplng Cut-based herarchcal ntegraton Frequency space analyss Lght Ray Tracng Backwards Ray Tracng [Arvo 86] Path Tracng: From Lghts Step 1. Choose a lght ray Step 2. Fnd ray-surface ntersecton Step 3. Reflect or transmt u = Unform( f u < reflectance(x Choose new drecton d ~ BRDF(O I goto Step 2 Bdrectonal Path Tracng Path pyramd (k = l + e = total number of bounces else f u < reflectance(x+transmttance(x Choose new drecton d ~ BTDF(O I goto Step 2 else // absorpton=1 reflectance-transmttance termnate on surface; depost energy 3
Comparson Why Photon Map? Some vsual effects lke caustcs hard wth standard path tracng from eye May usually mss lght source altogether Instead, store photons from lght n kd-tree Look-up nto ths as needed Combnes tracng from lght source, and eye Smlar to bdrectonal path tracng, but compute photon map only once for all eye rays Global Illumnaton usng Photon Maps H. Jensen. Renderng Technques (EGSR 1996, pp 21-30. (Also book: Realstc Image Synthess usng Photon Mappng Path Tracng: 1000 paths/pxel Note nose n caustcs Caustcs Photon Mappng: 10000 photons 50 photons n radance estmate Caustcs Sldes courtesy Henrk Wann Jensen Reflectons Insde a Metal Rng 50000 photons 50 photons to estmate radance Caustcs on Glossy Surfaces 30000 photons, 100 photons n radance estmate
HDR Envronment Illumnaton Global Illumnaton Drect Illumnaton Specular Reflecton Caustcs Indrect Illumnaton 5
Cornell Box Box: Global Photons 200000 global photons, 50000 caustc photons Mes House: Swmmng Pool Hstory and Outlne Is Monte Carlo Renderng solved? Can t be made more effcent (90s: Irradance cachng takes advantage of coherence Correct samplng: Stratfed, Multple Importance, Bdrectonal path tracng, Metropols Photon Mappng Work wth Image-Based Appearance (02-06 Importance samplng envronment maps, BRDFs Multdmensonal effects (depth-of feld, soft shadows, moton blur Adaptve multdmensonal samplng Cut-based herarchcal ntegraton Frequency space analyss Image-Based Appearance Standard global llumnaton s dffcult, but the emtters and reflectve propertes are smple In md-1990s, nterest n appearance acqured from real world, such as mage-based lghtng Envronment Maps, measured BRDFs. These are functons. E.g. any of mllon pxels emtter Structured Importance Samplng Goal: Reduce envronment to pont lghts How to (mportance sample lghtng, BRDFs? Agarwal et al. SIGGRAPH 03, Lawrence et al. SIGGRAPH 0, Clarberg et al. SIGGRAPH 05 6
Herarchcal Stratfcaton Structured Importance Samplng Glossy BRDF BRDF Samplng Lghtng s only one component. Must be able to mportance sample the BRDF n glob. Illum. In 200, no good mportance samplng schemes for most BRDFs, ncludng common Torrance-Sparrow From Lawrence et al. 0, factor BRDF nto datadrven terms that can each be mportance sampled Complex BRDF Models Motvaton Analytc Measured Cook-Torrance Measured Plastc [Cook & Torrance 1982] [Matusk et. al. 2003] Measured Metallc-Blue Measured Nckel 7
Key Idea Project D BRDF nto sum of products of 2D functon dependent on o and 2D functon dependent on : p f r ( o, ( n J j 1 F j( o G j( p depends only on the ncomng drecton and p some re-parameterzaton of the hemsphere. Key Idea Project D BRDF nto sum of products of 2D functon dependent on o and 2D functon dependent on : f (, ( n r o J j 1 F j( o G j( p p depends only on the ncomng drecton and some re-parameterzaton of the hemsphere. Measured Nckel BRDF Samplng Factored BRDF P( f r( o, ( n o Orgnal Reconstructon of 2-Term Factored Representaton (18KB F 1( o F 2( o F J ( o EVALUATE 0.1 0.75 0.1 SELECT TERM G 2( SAMPLE 300 Samples/Pxel Subsequent Work Multple Importance Samplng [Veach[ 95] of BRDF and Envronment Map [Lawrence 05] Fast Wavelet Products [Ng et al. 0] Wavelet Importance Samplng of product of lghtng and BRDF [Clarberg[ et al. 05] Some efforts to also consder vsblty Samplng Lafortune Ft Our Method 8
Hstory and Outlne Is Monte Carlo Renderng solved? Can t be made more effcent (90s: Irradance cachng takes advantage of coherence Correct samplng: Stratfed, Multple Importance, Bdrectonal path tracng, Metropols Photon Mappng Work wth Image-Based Appearance (02-06 Importance samplng envronment maps, BRDFs Multdmensonal effects (depth-of feld, soft shadows, moton blur Adaptve multdmensonal samplng Cut-based herarchcal ntegraton Frequency space analyss Lghtcuts Effcent, accurate complex llumnaton Envronment map lghtng & ndrect Textured area lghts & ndrect Tme 111s Tme 98s (60x80, Ant-alased, Glossy materals From Walter et al. SIGGRAPH 05 Complex Lghtng Smulate complex llumnaton usng pont lghts Area lghts HDR envronment maps Sun & sky lght Indrect llumnaton Key Concepts Lght Cluster Lght Tree Bnary tree of lghts and clusters Unfes llumnaton Enables tradeoffs between components Area lghts + Sun/sky + Indrect Clusters Indvdual Lghts 52 Key Concepts Smple Example Lght Cluster Lght Tree A Cut A set of nodes that parttons the lghts nto clusters #1 #2 #3 # Lght Tree Representatve Lght 1 Clusters Indvdual Lghts 53 5 9
Three Example Cuts Three Example Cuts Three Cuts Three Cuts #1 #2 # #1 #3 # #1 # #1 #2 # #1 #3 # #1 # 1 1 1 1 1 1 55 Good Bad Bad 56 Three Example Cuts Three Example Cuts Three Cuts Three Cuts #1 #2 # #1 #3 # #1 # #1 #2 # #1 #3 # #1 # 1 1 1 1 1 1 Bad Good Bad Good Good Good 57 58 Multdmensonal Adaptve Samplng Scenes wth moton blur, depth of feld, soft shadows Involves hgh-dmensonal ntegral, converges slowly Explot hgh-dmensonal nfo to sample adaptvely Mult-Dmensonal Adaptve Samplng [Hachsuka 08] Tableau, 630K polygons, 13000 lghts, (EnvMap+Indrect Avg. shadow rays per eye ray 17 (0.13% 59 10
Mult-Dmensonal Adaptve Samplng Recent Results Frequency Analyss and Sheared Reconstructon for Renderng Moton Blur Egan et al. 09 Fourer Depth of Feld Subr et al. 09 These papers consder frequency analyss of partcular phenomena sparse samplng, reconstructon. Moton Blur and Depth of Feld 32 samples per pxel Adaptve Wavelet Renderng Overbeck et al. 09 renders drectly nto wavelet doman for general hgh-d effects. Mnmal overhead: smple and fast Adaptve Wavelet Renderng 11