Presentation is loading. Please wait.

Presentation is loading. Please wait.

Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.

Similar presentations


Presentation on theme: "Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping."— Presentation transcript:

1 Global Illumination (3) Path Tracing

2 Overview Light Transport Notation Path Tracing Photon Mapping

3 Ray Tracing L(D)?S*E Rays cast from eye into scene –Why? –Because most rays cast from light wouldn’t reach eye objectslights

4 Ray Tracing L(D)?S*E Shadow rays cast at each intersection –Why? –Because most rays wouldn’t reach the light source objectslights

5 Ray Tracing L(D)?S*E Workload badly distributed –Why? –Because # of rays grows exponentially, and their result becomes less influential objectslights

6 Tough Cases Caustics –Light focuses through a specular surface onto a diffuse surface –LSDE –Which direction should secondary rays be cast to detect caustic?

7 Tough Cases Bleeding –Color of diffuse surface reflected in another diffuse surface –LDDE –Which direction should secondary rays be cast to detect bleeding?

8 Path Tracing Kajiya, SIGGRAPH 86 Diffuse reflection spawns infinite rays Pick one ray at random Cuts a path through the dense ray tree Still cast an extra shadow ray toward light source at each step in path Trace 40 paths per pixel objectslights

9 Path Tracing pure Monte Carlo reverse ray-tracing –rays are randomly diffused multiple samples taken at each pixel (distributed ray-tracing) can produce all global illumination effects, but is slower than Photon Mapping –more noise at same number of iterations

10 Monte Carlo (MC) Methods Stochastic techniques –meaning they are based on the use of random numbers and probability statistics to investigate problems. Used in everything from economics to nuclear physics to regulating the flow of traffic. To call something a "Monte Carlo" experiment, all you need to do is use random numbers to examine some problem.

11 Monte Carlo (MC) Methods MC methods to model physical problems allows us to examine more complex systems than we otherwise can. Solving equations which describe the interactions between two atoms is fairly simple; solving the same equations for hundreds or thousands of atoms is impossible. With MC methods, a large system can be sampled in a number of random configurations, and that data can be used to describe the system as a whole. "Hit and miss" integration is the simplest type of MC method to understand

12

13

14 Advantages of MC Integration Few restrictions on the integrand – Doesn’t need to be continuous, smooth,... – Only need to be able to evaluate at a point Extends to high-dimensional problems –Same convergence Conceptually straightforward Efficient for solving at just a few points

15 Disadvantages of MC Integration Noisy Slow convergence Good implementation is hard – Debugging code – Debugging maths – Choosing appropriate techniques

16 MC in Graphics: what can we integrate? Pixel: antialiasing Light sources: soft shadows Lens: depth of field Time: motion blur BRDF: glossy reflection Hemisphere: indirect lighting

17 Path Tracing An extension to ray tracing Simulates global illumination –Can handle all possible light bounces L(S|D)*E Stochastically samples all light paths Handles area light sources, diffuse reflections Approximates the integral of illumination

18 Send a ray through a pixel Trace the ray to its first intersected object From the intersected object, send out –One ray to each light source –One additional ray a diffusely reflected ray, a specularly reflected ray, or a transmissive ray Trace the ray and recursively follow it, as above Produces a ray “path” – not a ray tree Path Tracing

19 Trace only one secondary ray per recursion But send many primary rays per pixel (performs anti-aliasing as well) Monte Carlo Path Tracing

20 Light ray Eye Image plane Light

21 Illuminance ray Eye Image plane Light Specular? Diffuse? Transmission?

22 Path Tracing This provides a Monte Carlo approach to global illumination Stochastic samples are taken that should represent the actual surface properties

23 Path Tracing The lighting distribution is sampled by tracing rays stochastically along all possible light paths Averaging a large number of sample rays gives an estimate of the integral of all light paths through the pixel

24 Selecting the ray to trace How do we select which ray to trace? Each material has a k d, k s, and k t –Let k tot = k d + k s + k t –Select a random number R in the range (0, k tot ) –if (R < k d ) then send diffuse ray –else if (R < k d + k s ) then send specular ray –else send transmission ray

25 Computing the Diffuse reflection We can compute a random direction as follows: –Given two random numbers  1 in [0,1] and  2 in [0,1], the randomly reflected direction  d is given by  d = (  ) = (cos -1 (sqrt(  1 )), 2  2 )

26 Problems Need to trace a lot of rays to get an accurate image Typically trace 100 – 1000 rays per pixel

27 Problems Need to trace a lot of rays to get an accurate image Typically trace 100 – 1000 rays per pixel

28 http://graphics.stanford.edu/papers/combine/

29

30

31 Radiosity Diffuse surfaces Subdivide scene Radiosity assumed constant over a patch Form-factor between patches Geometry and visibility Big Matrix system

32 Radiosity vs. Monte Carlo We have an integral equation on an infinite space Finite elements (Radiosity) –Project onto finite basis of functions –Linear system Monte Carlo –Probabilistic sampling

33 Radiosity vs. Monte Carlo We have an integral equation on an infinite space Finite elements (Radiosity) –Project onto finite basis of functions –Linear system –View-independent (no angular information) Monte Carlo –Probabilistic sampling –View-dependent (but angular information)


Download ppt "Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping."

Similar presentations


Ads by Google