© Machiraju/Möller Rendering Equation Unbiased MC Methods CMPT 461/770 Advanced Computer Graphics Torsten Möller.

Slides:



Advertisements
Similar presentations
The Radiance Equation.
Advertisements

Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
Computer graphics & visualization Global Illumination Effects.
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
Advanced Computer Graphics
Photorealistic Rendering. Ray tracing v. photorealistic rendering What illumination effects are not captured by ray tracing? What illumination effects.
The Radiance Equation Mel Slater. Outline Introduction Light Simplifying Assumptions Radiance Reflectance The Radiance Equation Traditional Rendering.
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Path Differentials for MC Rendering Frank Suykens Department of Computer Science K.U.Leuven, Belgium Dagstuhl 2001: Stochastic methods in Rendering.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lectures 18, 19: Monte Carlo Integration Ravi Ramamoorthi Acknowledgements.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Photon Tracing with Arbitrary Materials Patrick Yau.
Advanced Computer Graphics (Fall 2009) CS 294, Rendering Lecture 5: Monte Carlo Path Tracing Ravi Ramamoorthi
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Rendering General BSDFs and BSSDFs Randy Rauwendaal.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 20: Monte Carlo Path Tracing Ravi Ramamoorthi Acknowledgements.
EGWR 2000 Metropolis Light Transport for Participating Media Mark Pauly Thomas KolligAlexander Keller ETH ZürichUniversity of Kaiserslautern.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CSCE 441 Computer Graphics: Radiosity Jinxiang Chai.
Computer Graphics (Spring 2008) COMS 4160, Lecture 22: Global Illumination
Global Illumination Jian Huang, CS 594, Fall 2002 This set of slides reference text book and the course note of Dutre et. al on SIGGRAPH 2001.
02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
02/25/05© 2005 University of Wisconsin Last Time Meshing Volume Scattering Radiometry (Adsorption and Emission)
-Global Illumination Techniques
02/16/05© 2005 University of Wisconsin Last Time Re-using paths –Irradiance Caching –Photon Mapping.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
02/10/03© 2003 University of Wisconsin Last Time Participating Media Assignment 2 –A solution program now exists, so you can preview what your solution.
Computer graphics & visualization Photon Mapping.
Computer Graphics Global Illumination: Photon Mapping, Participating Media Lecture 12 Taku Komura.
Path Integral Formulation of Light Transport
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
04/30/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling We are now all done with modeling, the standard hardware pipeline.
Global Illumination: Radiosity, Photon Mapping & Path Tracing Rama Hoetzlein, 2009 Lecture Notes Cornell University.
On robust Monte Carlo algorithms for multi-pass global illumination Frank Suykens – De Laet 17 September 2002.
Monte-Carlo Ray Tracing and
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Pure Path Tracing: the Good and the Bad Path tracing concentrates on important paths only –Those that hit the eye –Those from bright emitters/reflectors.
02/12/03© 2003 University of Wisconsin Last Time Intro to Monte-Carlo methods Probability.
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
Slide 1Lastra, 2/14/2016 Monte-Carlo Methods. Slide 2Lastra, 2/14/2016 Topics Kajiya’s paper –Showed that existing rendering methods are approximations.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
01/26/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
02/07/03© 2003 University of Wisconsin Last Time Finite element approach Two-pass approaches.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
02/9/05© 2005 University of Wisconsin Last Time Lights Next assignment – Implement Kubelka-Munk as a BSDF.
PATH INTEGRAL FORMULATION OF LIGHT TRANSPORT Jaroslav Křivánek Charles University in Prague
Computer graphics III – Multiple Importance Sampling Jaroslav Křivánek, MFF UK
Advanced Computer Graphics
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A.
Metropolis light transport
© 2002 University of Wisconsin
The Rendering Equation
© 2005 University of Wisconsin
(c) 2002 University of Wisconsin
Path Tracing (some material from University of Wisconsin)
(c) 2002 University of Wisconsin
Metropolis Light Transport for Participating Media
CS5500 Computer Graphics May 29, 2006
The Rendering Equation
OPTICS III, IV: Global Illumination
Metropolis Light Transit
Monte Carlo Path Tracing and Caching Illumination
Presentation transcript:

© Machiraju/Möller Rendering Equation Unbiased MC Methods CMPT 461/770 Advanced Computer Graphics Torsten Möller

© Machiraju/Möller Reading Chapter 16 of “Physically Based Rendering” by Pharr&Humphreys Chapter 19, 20 in “Principles of Digital Image Synthesis,” by A. Glassner

© Machiraju/Möller Direct Light General equation of existant radiance: Account only for direct light sources, i.e. Replace L i (p,  i ) with L i (p,  i ): –Most simple form of equation –Somewhat easy to solve! (but a gross simplification) –Kinda what we do in Whitted Ray-tracing –Not too bad - most energy comes from direct lights

© Machiraju/Möller Direct Light MC sampling to solve integral (A) –pick one light as representative for all lights –Distribute N samples for this light –Use multiple importance sampling for f r and L d –Scale the result by the total number of lights N L

© Machiraju/Möller Multiple Importance Sampling Weight according to f light Weight according to L d light

© Machiraju/Möller Direct Light (B) uniformly sample all lights –Do (A) for each light source –Sum the result –Smarter approach - non-uniform sampling of light sources: prefer lights with has higher power

© Machiraju/Möller Light Transport Equation Incident radiance effected by all geometry and scattering within a scene (colour bleeding) Global illumination Principle –Ignore wave optics –Energy balance (radiance is in equilibrium) Power leaving Power entering Power emitted Power absorbed

© Machiraju/Möller Light Transport Equation If no participating media - express incoming in terms of outgoing radiance: Need to solve for L (only one unknown)

© Machiraju/Möller Example - lambertian light One spherical light source on the outside No scene geometry Lambertian BSDF, f r =c Emitted radiance L e in constant is the same, no matter which point on the light. Hence:

© Machiraju/Möller Example cont. Let’s solve the last equation a little weirdly: These are basically the number of bounces  hh is the reflectance von Neumann series - principle solution method

© Machiraju/Möller Example - direct lighting Using recursion for direct lighting: The last term is being ignored; represents secondary (bounced) light

© Machiraju/Möller Expressing LTE in terms of geometry within the scene Replacing the integrand (d  i )with an area integrator over the whole scene geometry and remembering: - visibility term (either one or zero) LTE - Geometric Formulation

© Machiraju/Möller Geometry coupling term New (geometric) formulation of the Light Transport Equation (LTE) Randomly pick points in the scene and create a path vs. (previously) randomly pick directions over a sphere LTE - Geometric Formulation

© Machiraju/Möller LTE - Geometric Formulation Recursive evaluation

© Machiraju/Möller compact formulation: For a path Where p 0 is the camera and p i is a light source LTE - Geometric Formulation

© Machiraju/Möller with: Where Is called the throughput Special case: LTE - Geometric Formulation

© Machiraju/Möller Again - handle with care (e.g. point light): E.g. Whitted ray tracing only uses specular BSDF’s Specular distributions

© Machiraju/Möller Solving the LTE Many different algorithms proposed to deal with Most energy in the first few bounces: emitted radiance at p 1 one bounce to light (direct lighting)

© Machiraju/Möller Solving the LTE Simplify according to small and large light sources: Can be handled separatly (different number of samples)

© Machiraju/Möller Solving the LTE Similarly, we can split BxDF into delta and non-delta distributions: This creates many factors that cannot be ignores

© Machiraju/Möller Measuring over a pixel Integrating over pixel j: Where We is the filter function around a pixel:

© Machiraju/Möller Integrating over a pixel And hence the integral: A - light bounces around until it hits the camera B - a quantity from the sensor bounces around and only makes a contribution if it hits a light

© Machiraju/Möller Path Tracing Kajiya 1986; solution to A.How to deal with infinite sum? B.For a particular i - how to generate one or more paths to estimate

© Machiraju/Möller A) Infinite Sum In general => the longer the path the less the impact Use Russian Roulette after a finite number of bounces –always compute first few terms –Stop after that with probability q

© Machiraju/Möller A) Infinite Sum Use probability q i after each

© Machiraju/Möller B) Path Generation Pick a surface in the scene at random (I.e. uniform probability distribution): Pick a point on this surface at random (uniform) with probability 1/A i Overall probability of picking a random surface point in the scene:

© Machiraju/Möller B) Path Generation This is repeated for each point on the path Last point should be sampled on a light source If we know things about the scene (which objects are contributing most indirect lighting to the scene) we can sample more smartly Problems: –High variance - only few points are mutually visible –Incorrect integral - for delta distributions

© Machiraju/Möller For path –At each p j find p j+1 according to BSDF –At p i-1 find p i by multiple importance sampling of BSDF and L d This algorithm distributes samples according to solid angle (  ) instead of area Hence prob. Distribution p A needs to be adjusted: B) Incremental Path Generation

© Machiraju/Möller MC estimator: Implementation: –Re-use path for new path Introduces correlation, but speed makes up for it B) Incremental Path Generation

© Machiraju/Möller Path Tracing

© Machiraju/Möller Path Tracing Direct lighting only 1024 samples per pixel 8 samples per pixel

© Machiraju/Möller Pure Path Tracing Best for big luminaires. If lights small, few hits and large variance.

© Machiraju/Möller Results Objects are gray, except for spheres and base. –Color bleeding –Caustics

© Machiraju/Möller Results 401 minutes 533 minutes 256 x 256 image Ray Traced (no ambient) Path Traced Light scattered by sphere

© Machiraju/Möller Bi-directional path tracing Compose one path from two paths – started at the camera p 0 and – started at the light source q 0 Modifications for efficiency: a)Use all i+j paths: b)For all paths replace q 1 with direct lighting computation like normal path tracing

© Machiraju/Möller Bi-directional path tracing When useful? –Light sources difficult to reach –Specific BSDF evaluations (caustics)

© Machiraju/Möller Bi-direct RT : Pseudo-Code

© Machiraju/Möller Pure Bi-Directional: Analysis Advantages: –Each ray cast contributes to many paths –Building from both ends can catch difficult cases All specular paths Caustics –Extends to participating media (anisotropic, heterogeneous) Disadvantages: –Still using lots of effort to catch slow varying diffuse components –May not sample difficult to find paths –Does allow for much noise to be present

© Machiraju/Möller Still Tough Cases Caustics –How do you know which direction to cast eye rays to reach the interesting light? Bleeding –How do you know which rays to reflect to reach the interesting parts of diffuse reflections?

© Machiraju/Möller MC Algorithms Revisited Provide ability to sample light transport paths. MC algorithms studied so far sample a function to compute the value of an integral. Problems: –Many of the paths are unimportant. –Pure Bi-Directional Path algorithm does not reject. –It may weigh down some paths.

© Machiraju/Möller Metropolis’s Idea Circa 1953 Generate a distribution of samples proportional to the unknown function For rendering – –sample image with ray density proportional to radiance –random walk through path space Eric Veach’s PhD thesis and Veach&Guibas paper in Siggraph introduced work of Metropolis to Graphics

© Machiraju/Möller Why Does It Make Sense ? In the final image: –More detail in brighter areas –Value of a pixel will be proportional to the number of times it was sampled in a path

© Machiraju/Möller  Metropolis sampling Metropolis Light Transport Generate a random walk through path space For each path deposit a constant amount of energy at the corresponding pixel Obtain desired image by distributing paths according to image contribution

© Machiraju/Möller Importance function Problem: F(X) is not scalar for colored scenes. Scalar Importance function: I(X)=Lum(F(X)) –Importance sampling: p(X) = I(X) /b P =  F(X)dX=  F/I ·I dX= b ·  F/I · p dX = b ·E[F/I] = b ·1/M ·  F(Xi)/I(Xi) Meaning of b: Luminance of the total power

© Machiraju/Möller MLT Essentials Generate samples with probability p(X) Evaluate I(X) : luminance of the power of a path Evaluate b: Tone mapping or estimation by normal rendering Good initial samples: estimation by normal rendering

© Machiraju/Möller Overview In order to sample paths, MLT uses a random walk through the space of possible paths. MLT will choose a new path Xi by performing a random mutation on Xi-1. New path can be rejected (if it goes through a wall) Lastly, upon choosing each new path, MLT will update the appropriate image pixel(s).

© Machiraju/Möller Propose a mutation of current path Compute acceptance probability Choose as new sample if  Samples are correlated  we can exploit coherence Metropolis Sampling

© Machiraju/Möller Where is the image contribution function (contribution made to the image by light flowing through ) tentative transition function - probability of given Metropolis Sampling

© Machiraju/Möller Metropolis light transport LeLe Mutations pixel

© Machiraju/Möller MLT: Pseudo-Code

© Machiraju/Möller Scattering Perturbations Propagation Perturbations Sensor Perturbations Caustic Perturbations Mutation Strategies Bidirectional Mutations –large changes to the current path –ensures ergodicity Perturbations –high acceptance probability –changes to image location –low cost

© Machiraju/Möller Bidirectional Mutations Given a path 1.Choose a random subpath to delete. 2.Add random numbers of new vertices to the new interior endpoints of X. 3.Try to connect up the two innermost vertices. 4.Test for acceptance of the new path.

© Machiraju/Möller  x1x1 x2x2 x0x0 Mutations – Step 1

© Machiraju/Möller Mutations – Step 1 Random subpath to delete. Weigh probability so that smaller subpaths are chosen more frequently.  x1x1 x2x2 x0x0

© Machiraju/Möller Mutations – Step 2 Add random numbers of new vertices. Choose number to add from a distribution centered around old number. Choose where to put the break (i.e. how many to add at end of first segment vs. beginning of last segment). Add each vertex by sampling a direction according to a BRDF, and then casting a ray.

© Machiraju/Möller x2x2 Mutations – Step 2 Chose to add 2 vertices, with the break between them.  x0x0

© Machiraju/Möller x2x2 x1x1 Mutations – Step 3 Connect two innermost vertices Test if two new endpoints are visible If the path is obstructed, reject the mutation  x0x0 x3x3

© Machiraju/Möller Test for acceptance of the new path Y over old path X. Use Note that much of this can be pre- computed. Mutations – Step 4

© Machiraju/Möller  Good Mutations Don’t make changes that are too small Don’t get stuck

© Machiraju/Möller Perturbations Are needed when bidirectional mutations will nearly always be rejected. When there are small regions of the path space in which paths contribute much more than average. –Lenses –Caustics Smaller mutations keep them within high contribution region

© Machiraju/Möller –Propagation Perturbation image plane medium light source eye

© Machiraju/Möller Propagation Perturbations image plane medium light source eye

© Machiraju/Möller Perturbations Move the pixel location (i.e. the path’s endpoint) by a random distance in a random direction. Recast rays through all the specular bounces so that it retains the same length. Mutation strategy depends on what is encountered For example in the caustic LS+DE case make small change in ray connecting the diffuse and specular surface

© Machiraju/Möller Caveat Run several copies of the algorithm in parallel. –Helps to remove startup bias. –Helps to test for convergence. Ignore the first several path samples. –Helps to remove startup bias. Don’t bother with MLT for the direct lighting in an image. –Standard techniques for direct lighting usually provide better quality at lower cost. –This way MLT can devote more effort to the indirect lighting.

© Machiraju/Möller

Results Light for this example comes only through crack in doorway

© Machiraju/Möller Results There are specific mutations to capture caustics.

© Machiraju/Möller Good For Portions of space where light comes through hole in the wall kinds –mutations will explore new paths once it finds a path through the hole – Bi-directional and Plain Path Tracing use random directions

© Machiraju/Möller Not Good For Cornell Box scenes will not benefit Caustics will certainly help. Too many holes does not help Also caustics from mirror reflections

© Machiraju/Möller Results

© Machiraju/Möller Results

© Machiraju/Möller Results

© Machiraju/Möller Transport Approximations Classical ray tracing –Direct Lambertian –Global specular Radiosity –Diffuse to diffuse global illumination –View independent. Monte Carlo Methods –More comprehensive –Can be Expensive

© Machiraju/Möller Transport Light == particles of energy or photons moving in straight lines in a vacuum No interaction among particles. There are infinite number of particles moving at same speed Particles interact with surfaces in a closed environment Energy is conserved. A steady state of energy transfer between all surfaces

© Machiraju/Möller Steady State Audit for flux Accumulation = flow through boundaries - flow out of boundaries + generation within system - absorption within system.