home/ atoms/ monte-carlo-importance-sampling

Importance sampling reduces Monte Carlo variance by drawing samples proportional to the integrand's magnitude

Monte Carlo integration estimates an integral ∫f(x)dx ≈ (1/n)Σf(X_i)/p(X_i) where X_i are drawn from distribution p. When p matches f’s shape (proportional to f), the quotient f/p is constant and variance drops to zero. In practice, p cannot exactly match the unknown integrand, but sampling proportional to known factors (BSDF, cosine term, light source intensity) concentrates samples where the integrand is large, reducing the error for a given sample count. For path tracing, importance sampling the BSDF or light distribution is the primary variance-reduction technique. Multiple importance sampling (MIS) combines several sampling strategies optimally. Without importance sampling, rendering complex scenes requires prohibitively many samples.

Examples

Sampling the BSDF vs. uniform hemisphere sampling: for a glossy material, most hemisphere directions contribute near-zero radiance. BSDF importance sampling places 90%+ of samples in the sharp specular lobe where they matter, reducing noise dramatically.

Assessment

Given a 2D integral with a sharp Gaussian peak, compare (numerically or by sketch) the variance of: (a) uniform sampling, (b) Gaussian importance sampling. Calculate how many times more samples option (a) needs to match option (b)‘s error.

“carefully choosing the PDF from which samples are drawn leads to a key technique for reducing error in Monte Carlo.”