Quiz: path tracing

Short questions to test your understanding. Try each on paper first, then open the answer. N is the number of samples (paths) per pixel.


Q1. Name three effects a path tracer shows that a Whitted ray tracer cannot, and say for each why Whitted misses it.

Whitted follows the mirror and refraction directions and shadow rays to point lights.

Soft shadows (a point light is either visible or not; an area lamp is partly visible). Colour bleeding (light bounces off a coloured matte wall in all directions; Whitted never follows those directions). Caustics (light focused through glass onto a matte floor; Whitted’s shadow ray from the floor is blocked by the glass). Also glossy reflections.


Q2. A path-traced image at 16 samples per pixel has a noise standard deviation of 0.08. How many samples do you need for 0.04? For 0.008?

Noise \propto 1/\sqrt N.

Half the noise needs 4× the samples: 64. A tenth needs 100×: 1600.


Q3. A 16-spp render has a PSNR of 22 dB against a converged reference. Predict the PSNR at 256 spp.

MSE \propto 1/N; PSNR changes by 10\log_{10} of the MSE ratio.

16× the samples divide the MSE by 16: +10\log_{10}16 = +12 dB, so about 34 dB (+3 dB per doubling, four doublings).


Q4. Why is a Monte Carlo estimate called unbiased, and why does that not mean it is accurate?

Average over many repeats versus one estimate.

Unbiased: averaged over many independent repeats, the estimate equals the true integral. One estimate still has a random error with standard deviation \sigma/\sqrt N; with few samples (or a large \sigma) it can be far off.


Q5. A matte floor is lit by a tiny bright lamp. Directions are sampled cosine-weighted. Why do isolated very bright pixels (fireflies) appear, and what removes them?

How often does a random direction hit a tiny lamp, and how large is the sample when it does?

A random direction hits the tiny lamp very rarely; most pixels never hit it (too dark), and the few that do get one enormous sample f/p (too bright). On average it is right, but the variance is huge. Sampling the lamp directly (a point on the lamp plus a shadow ray, at every matte hit) gives every sample a moderate value: the fireflies disappear.


Q6. A renderer samples directions with a pdf that is zero in a cone where a lamp happens to be. What happens to the image as N grows?

Can a sample ever see that lamp?

It converges, smoothly, to the wrong image: the light from that lamp is never sampled, so it is missing from the average. This is bias, not noise, and more samples do not help. A pdf must be positive wherever the integrand is.


Q7. A denoiser turns a 16-spp render into an image with a lower RMSE than the 64-spp render. Is the denoised image “better”? What may be lost?

Variance against bias; recall the deconvolution day.

It has less error overall, but it is biased: the denoiser has smoothed things that were real, typically soft shadow edges, caustics and fine texture, which have no edge in the normal/albedo guides. The 64-spp image is noisier but unbiased. Whether “better” depends on what you look at: for measuring a shadow edge, the unbiased image is safer.


Q8. (math) Show that cosine-weighted sampling, p(\boldsymbol\omega) = \cos\theta/\pi, of a Lambertian surface (albedo \rho) under a constant sky L gives the same value for every sample. What is that value?

The sample is f_r L \cos\theta / p with f_r = \rho/\pi.

\dfrac{(\rho/\pi)\,L\cos\theta}{\cos\theta/\pi} = \rho L, independent of the direction: zero variance, every sample is exactly the answer \rho L (the outgoing radiance of a matte surface under a uniform sky).