Presentation is loading. Please wait.

Presentation is loading. Please wait.

02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro.

Similar presentations


Presentation on theme: "02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro."— Presentation transcript:

1 02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro

2 02/11/05© 2005 University of Wisconsin Today Path Tracing

3 02/11/05© 2005 University of Wisconsin Light Transport Equation (Sect 16.2) Power leaving is power emitted plus incoming power that is scattered The trace operation, t(p,  ) traces a ray and finds the first surface seen There are many variants on this equation –Mostly related to changing domain of integration

4 02/11/05© 2005 University of Wisconsin Interior of a Sphere All points emit a constant amount, and also have diffuse reflectance Symmetric, so all radiance leaving surface pts is the same

5 02/11/05© 2005 University of Wisconsin Another view … Repeatedly substitute LHS into RHS: There is a physical interpretation to this: –L e : no bounces, paths of length 1 –  hd L e : 1 bounce, paths of length 2 –…

6 02/11/05© 2005 University of Wisconsin Sampling the LTE over Directions The integral is over directions (solid angle measure) To sample this, we would start at the eye and choose directions based on the BSDF –See what we hit with the trace operator –Probabilities would be based on solid angle measure Some algorithms use this formulation Others use the surface area form …

7 02/11/05© 2005 University of Wisconsin Point-to-Point Definitions Switch definitions to point-to-point form:  ’’

8 02/11/05© 2005 University of Wisconsin LTE Over Area We can switch domains to be over surface area –Need another cos  /r 2 term to switch measure –Need a visibility term to make sure we only include points that can see each other V=1 iff the points can see each other, otherwise 0 To solve this, we sample points on surfaces –Express probabilities in terms of area measures

9 02/11/05© 2005 University of Wisconsin The Geometry Term Simplifies the equations significantly, but don’t forget it’s where much of the complexity lies Note this term is defined for any two points in the scene, but for most pairs in most scenes it will be 0 due to the visibility term

10 02/11/05© 2005 University of Wisconsin Expanding the LTE We can substitute the LHS into the integral to expand this equation –Mathematically, it’s a Neumann expansion of a linear operator One step:

11 02/11/05© 2005 University of Wisconsin Contributions of Paths to Length 3 p0p0 p1p1 p0p0 p2p2 Le(p1p0)Le(p1p0) Le(p2p1)Le(p2p1) p1p1 G(p2p1)G(p2p1)f(p 2  p 1  p 0 ) p0p0 p3p3 Le(p3p2)Le(p3p2) p1p1 G(p2p1)G(p2p1) p2p2 G(p3p2)G(p3p2)f(p 3  p 2  p 1 ) Every extra bounce adds another reflectance/geometry term Total radiance to p 0 is the sum over all paths of all lengths

12 02/11/05© 2005 University of Wisconsin Infinite Expansion Define to be the path from a light to p 0 with i+1 vertices p0p0 p3p3 Le(p3p2)Le(p3p2) p1p1 G(p2p1)G(p2p1)f(p 2  p 1  p 0 ) p2p2 G(p3p2)G(p3p2)f(p 3  p 2  p 1 )

13 02/11/05© 2005 University of Wisconsin Computing Images We need one more equation – to convert the radiance into a pixel value, or any other measurement Consider a pixel j, for which we want the value, I j W e is the measurement function, which computes the ray’s contribution to pixel j –It includes the pixel filter and something to confirm that the ray actually makes it to the pixel

14 02/11/05© 2005 University of Wisconsin Measurement Functions We can define different measurement functions for different situations –For instance, with depth of field, the measurement function would take into account the aperture and lens system –Or, for precomputing illumination for later real-time rendering, the measurement function would integrate light arriving at a triangle in the scene –The latter is a real application – building light maps for games For the case of rays to the eye, W e is the visual importance of the path

15 02/11/05© 2005 University of Wisconsin Monte Carlo Integration We want to evaluate the integral How?

16 02/11/05© 2005 University of Wisconsin Conceptually We sample paths, somehow –Each path has a value according to the integrand –Each path has some probability associated with it –We evaluate the Monte Carlo estimator Some trickiness with sum of integrals, but falls out nicely The problem is, how do we sample paths? –There is an infinite sum – do we need to compute infinite length paths? –How do we make sure that the paths we sample are important? Have high probability of choosing paths with high contributions

17 02/11/05© 2005 University of Wisconsin Path Tracing (PBR 16.3) 1.Start with a ray sample through a pixel 2.If you hit a light, stop and return the radiance a)This is a sample of a length 2 path 3.If not a specular surface a)Do a direct lighting computation (sample 1 light) – this is a length 3 path b)Add it’s contribution to the image 4.Sampling an outgoing direction according to the BSDF, cast a ray 5.Go to step 2, but now the path length is one longer 6.Keep going, creating longer and longer paths…

18 02/11/05© 2005 University of Wisconsin Infinite paths? We can’t go on forever, path throughput gets smaller and smaller Russian Roulette: –At each step, before casting the next ray, make a random choice to stop: stop with probability q i –If you decide not to stop, weight new ray’s contribution by 1/(1- q i ) –Eventually, one of the random choices will say stop, particularly if you base the choice on the throughput to this point This is an essential technique in any algorithm that traces paths and aims to be unbiased

19 02/11/05© 2005 University of Wisconsin Stratification? It is good to stratify the sampling of the BRDF and the lights But the benefits of this go down with increasing path length The PBRT implementation stratifies the first three bounces, but not the rest

20 02/11/05© 2005 University of Wisconsin Path Tracing Results 1024 samples per pixel

21 02/11/05© 2005 University of Wisconsin Noisy with Low Sampling 8 samples per pixel

22 02/11/05© 2005 University of Wisconsin Path Tracing Analysis Arbitrary geometry and BSDFs –No need for surface parameterizations Doesn’t waste time on things that aren’t visible Unlike ray tracing, spends equal time on all path lengths (ray tracing spends more time on longer paths) Downsides: –All the decisions are local – based on BSDF at hit point –What information is missing? –Does not share information from different ray-trees to build better paths

23 02/11/05© 2005 University of Wisconsin Failure Mode

24 02/11/05© 2005 University of Wisconsin Bi-Directional Path Tracing Veach 94; Lafortune and Willems 94 Build a path by working from the eye and the light and join in the middle Don’t just look at overall path, also weigh contributions from all sub- paths: p1p1 p2p2 p3p3 p 4 Light

25 02/11/05© 2005 University of Wisconsin Bi-Directional Optimizations After constructing paths, throw away last link to the light –Then use direct lighting integrator to compute incoming radiance at path endpoints Use multiple importance sampling (last lecture) to weight each path’s contribution We would really appreciate it if someone implemented this for their project

26 02/11/05© 2005 University of Wisconsin 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

27 02/11/05© 2005 University of Wisconsin Metropolis Light Transport Other algorithms generate independent samples –Easy to control bias Metropolis algorithms generate a sequence of paths where each path can depend on the previous one For each sample: –Propose a new candidate depending on the previous sample –Choose to accept or reject according to a computed probability (if reject, re-use the old sample) Can prove the estimates for pixel intensities are correct

28 02/11/05© 2005 University of Wisconsin Metropolis Proposal Strategies Task: Given the previous sample, generate a new one –Should be very different, but should also be good Methods: –Randomly chop out some part of the path and replace it with a new piece –Randomly perturb a vertex on the path –Less randomly change the pixel that is affected –Other choices possible

29 02/11/05© 2005 University of Wisconsin Light Through Ripples http://graphics.stanford.edu/papers/metro/

30 02/11/05© 2005 University of Wisconsin Light Through Ripples (Path tracing) http://graphics.stanford.edu/papers/metro/

31 02/11/05© 2005 University of Wisconsin Metropolis: Analysis Can give unbiased estimates of difficult scenarios: –Light through a crack, almost impossible any other way –Caustics from light reflecting off the bottom of a wavy pool Hard to implement – but we have an implementation for PBRT –The details of computing probabilities are difficult –Several optimizations are required for good results Easy to coarsely parallelize But, still computes diffuse illumination on a per point basis

32 02/11/05© 2005 University of Wisconsin One more scene Metropolis still has trouble in one situation –Spot the error in these images

33 02/11/05© 2005 University of Wisconsin Next Time Irradiance Caching Photon Mapping


Download ppt "02/11/05© 2005 University of Wisconsin Last Time Direct Lighting Light Transport Equation (LTE) Intro."

Similar presentations


Ads by Google