Advanced Computer Graphcs (Fall 2009 CS 29, Renderng Lecture 6: Recent Advances n Monte Carlo Offlne Renderng Rav Ramamoorth http://nst.eecs.berkeley.edu/~cs29-13/fa09 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 Spectrally Optmal Samplng D. Mtchell 95, Consequences of stratfed samplng n graphcs Mtchell 91 2
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 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 Backwards Ray Tracng [Arvo 86] 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 Bdrectonal Path Tracng Path pyramd (k = l + e = total number of bounces Comparson 3
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 Sldes courtesy Henrk Wann Jensen Photon Mappng: 10000 photons 50 photons n radance estmate Caustcs Reflectons Insde a Metal Rng 50000 photons 50 photons to estmate radance Caustcs on Glossy Surfaces HDR Envronment Illumnaton 30000 photons, 100 photons n radance estmate
Global Illumnaton Drect Illumnaton Specular Reflecton Caustcs Indrect Illumnaton Cornell Box 200000 global photons, 50000 caustc photons 5
Box: Global 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 How to (mportance sample lghtng, BRDFs? Agarwal et al. SIGGRAPH 03, Lawrence et al. SIGGRAPH 0, Clarberg et al. SIGGRAPH 05 Structured Importance Samplng Goal: Reduce envronment to pont lghts Herarchcal Stratfcaton 6
Structured Importance Samplng Glossy BRDF BRDF Samplng Complex BRDF Models 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 Analytc Measured [Cook & Torrance 1982] [Matusk et. al. 2003] Motvaton Key Idea Cook-Torrance Measured Plastc Project D BRDF nto sum of products of 2D functon dependent on o and 2D functon dependent on : f r ( o, ( n J j 1 F j( o G j( p Measured Metallc-Blue Measured Nckel p depends only on the ncomng drecton and p some re-parameterzaton of the hemsphere. 7
Key Idea Measured Nckel BRDF 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. Orgnal Reconstructon of 2-Term Factored Representaton (18KB Samplng Factored BRDF P( f r( o, ( n o 300 Samples/Pxel F 1( o F 2( o F J ( o EVALUATE 0.1 0.75 0.1 SELECT TERM G 2( SAMPLE Samplng Lafortune Ft Our Method 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 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 8
Lghtcuts Effcent, accurate complex llumnaton Complex Lghtng Smulate complex llumnaton usng pont lghts Area lghts HDR envronment maps Sun & sky lght Indrect llumnaton Envronment map lghtng & ndrect Textured area lghts & ndrect Tme 111s Tme 98s (60x80, Ant-alased, Glossy materals From Walter et al. SIGGRAPH 05 Unfes llumnaton Enables tradeoffs between components Area lghts + Sun/sky + Indrect Key Concepts Key Concepts Lght Cluster Lght Cluster Lght Tree Lght Tree Bnary tree of lghts and clusters A Cut A set of nodes that parttons the lghts nto clusters Clusters Indvdual Lghts 51 52 Smple Example Three Example Cuts Three Cuts Lght Tree #1 #2 # #1 #3 # #1 # #1 #2 #3 # Representatve Lght 1 Clusters 1 2 3 Indvdual Lghts 1 1 1 1 2 3 1 2 3 1 2 3 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 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 Good Bad Bad Bad Good Bad 55 56 Three Example Cuts Three Cuts #1 #2 # #1 #3 # #1 # 1 1 1 1 2 3 1 2 3 1 2 3 Good Good Good 57 Tableau, 630K polygons, 13000 lghts, (EnvMap+Indrect Avg. shadow rays per eye ray 17 (0.13% 58 Multdmensonal Adaptve Samplng Mult-Dmensonal 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] Moton Blur and Depth of Feld 32 samples per pxel 10
Recent Results Adaptve Wavelet Renderng 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. Adaptve Wavelet Renderng Overbeck et al. 09 renders drectly nto wavelet doman for general hgh-d effects. Mnmal overhead: smple and fast 11