CSE 167 Lecture Notes - Lecture 18: Importance Sampling, Path Tracing, Bidirectional Reflectance Distribution Function
Document Summary
Idea: integrate radiance for each pixel by sampling paths randomly. Outgoing light: l0(x, w) = le(x, w) + fr(x, w", w) li(x, w)(w dot n) dw. For each pixel, cast n samples and average. Choose a ray w/ p=camera, d= ( , ) within pixel. Pixel color += (1/n) * tracepath(p, d) Tracepath(p, d) returns (r, g, b) [and calls itself recursively] Trace ray (p, d) to find nearest intersection p". Return 2 * (lered, legreen, leblue) // 2 = 1/(50%) Return 2 * fr(d d") * (n dot d") * tracepath(p", d") Final image is the sum of emissions and reflections. In general, you divide by the probability of choosing the path. That division is what leads to fireflies . 1 g(x) p(x) dx sample according to some probability p. When we hit an emitted path! (but it"s probabilistic! We can keep hitting reflectionsbut at some point we"re going to terminate) Pick paths based on energy or expected contribution.