2009-01-18 23:57
Monte Carlo integration is a simple and general way to compute a (conditional) probability, expected value, etc.
Different ways to sample from the unit disk:
- Uniform x,y, then reject if too far from center.
 - Uniform x,y, then scale and accept (or weight) by probability (or importance) max(|sin θ|, |cos θ|).
 - Uniform r,θ, then accept (or weight) with probability (or importance) r.
 - Uniform r²,θ, then compute r = √r².
 - Uniform u,v,θ, then compute r = max(u,v).
 - Stratify by dividing the range of say θ into intervals?
 
Different ways to sample sun rays:
- Uniform direction (from a sphere), then uniform offset (from a disk).
 - Uniform surface point (from a sphere), then cosine direction (from a hemisphere, by picking, rejection, or importance).
 - Work backwards from the eye!