Bidirectional Path Tracing Path Tracing See Pharrs PBRT
Bidirectional Path Tracing
Path Tracing • See Pharr’s PBRT 2 nd Ed. 15. 3
DIRECT LIGHTING
Source: Eric Veach, “Robust Monte Carlo Methods for Light Transport Simulation” Page 255, Figure 9. 2. Ph. D. Thesis, Stanford University
Integral of BRDF and Light • Rendering Equation (revisted) • Ignoring emitted light and occlusion, we still have an expensive integral: • Let f(Xi)= (…) I (…) and evaluate its integral with Monte Carlo methods.
Integral of BRDF and Light • Let f(Xi)= (…) I (…) and evaluate its integral. • Case 1: a diffuse surface and a few area lights • Case 2: a specular surface and environment lighting • Uniform sampling isn’t efficient in both cases. Why? (…) I (…)
Exercise on Direct Lighting • How to compute the rendering equation for direct lighting?
Solving it by Ray Tracing? • No reflective ray is actually traced. • We compute the integral using the Phong lighting model. • The light source is simplified to a point light.
Solving it by Cook’s Ray Tracing? • Still no reflective ray is actually traced. • We compute the integral using the Phong lighting model. • But the light source is randomly sampled on the sphere.
Solving it by Path Tracing? • Many reflective rays are randomly chosen to compute the integral. • The ray may be chosen based on material or based on the light source. • If the reflective ray hits the light, its contribution I(x’, x”) is included.
Monte Carlo Path Tracing offers the insight to: RADIANCE & IRRADIANCE
What Is Light Intensity? • The power of light source – E. g. , wattage of a light bulb. – Flux (Φ) measured in watts (W) or joules/second • Does it change with distance? – Another radiometric quantity needed here. – Next slide: Irradiance (E)
Radiance and Irradiance • Irradiance E – Area density of flux. – Measured in W/m 2 – E = Φ / 4πr 2 • Radiance L – Light energy density – Measured in W/(sr-m 2) – Remains constant along rays From Watt’s p. 278
Exercise on Direct Lighting • Q 1: How to compute • Q 2: What is the contribution of the light spheres? Does it change with the distance? • • Ans: Let’s assume the light sphere has radius r and its distance to the surface is d. The probability of the sample ray hits the sphere is proportional to r^2, but its intensity is 1/r^2. So the integral is the same (independent of r). Now let’s look at d. When the r is fixed, whenever the sample ray hits the light sphere, its intensity should be the same. That means the radiance! (But the integral will decrease by 1/d^2. )
IMPORTANCE SAMPLING
Exercise on PDF • Q 1: What is the p(x) for uniform sampling (or Lambertian BRDF)? – 小心range是 0 -1,pdf總和為 1,因此uniform pdf(x)=1 – See also Google Keep (SIGGRAPH Courses Reading Notes) • Q 2: How to pick p(x) for a diffuse Lambertain BRDF, a glossy BRDF, and a specular reflection?
Exercise on Importance Sampling • How to estimate the average of the following if we are only allowed to pick one Xi? • What if the dice is biased toward larger numbers? f(Xi) Xi
Exercise • Assuming a fair dice. • If we render an image, the pixel values may look like: 0, 0, 0, 6, 0, 0, . . . p(Xi) f(Xi) Xi Xi
Exercise • Assuming a dice can only produce 4, 5, 6. • If we render an image, the pixel values may look like: 0, 3, 0, 0, 0, 3, . . . • Note that pdf(Xi)=2 for Xi=4, 5, 6 p(Xi) f(Xi) Xi Xi
Exercise • Assuming a dice that is stuck at 6. • If we render an image, the pixel values may look like: 1, 1, 1, . . . • pdf(6)=6 and pdf(Xi)=0 if Xi=1. . 5 p(Xi) f(Xi) Xi Xi
BIDIRECTIONAL PATH TRACING
Bidirectional Path Tracing • Definition: Source: Eric Veach’s Ph. D thesis, Ch. 10
Source: Eric Veach’s Ph. D thesis, Ch. 10
Backup Slides
Biased Distribution • What if the probability distribution (p(x)) of the samples is not uniform? • Example: – What is the expected value of a flawless dice? – What if the dice is flawed and the number 6 appears twice as often as the other numbers? – How to fix it to get the same expected value?
Example – Throwing a Dice • How to estimate the average of the following if we are only allowed to pick one Xi? • What if the dice is biased toward larger numbers? f(Xi) Xi
Exercise • Assuming a fair dice. • If we render an image, the pixel values may look like: 0, 0, 0, 6, 0, 0, . . . p(Xi) f(Xi) Xi Xi
Exercise • Assuming a dice can only produce 4, 5, 6. • If we render an image, the pixel values may look like: 0, 3, 0, 0, 0, 3, . . . • Note that pdf(Xi)=2 for Xi=4, 5, 6 p(Xi) f(Xi) Xi Xi
Exercise • Assuming a dice that is stuck at 6. • If we render an image, the pixel values may look like: 1, 1, 1, . . . • pdf(6)=6 and pdf(Xi)=0 if Xi=1. . 5 p(Xi) f(Xi) Xi Xi
Noise in Rendered Images • The variance (in estimation of the integral) shows up as noise in the rendered images.
Importance Sampling • One way to reduce the variance (with a fixed number of samples) is to use more samples in more “important” parts. • Brighter illumination tends to be more important. • More detail in Veach’s thesis and his “Metropolis Light Transport” paper.
The End
- Slides: 34