home/ atoms/ antialiasing-supersampling

Antialiasing in ray tracing averages multiple randomly-offset rays per pixel

In a naive ray tracer, each pixel fires exactly one ray through its center, producing aliased edges. Antialiasing fires multiple rays per pixel with random sub-pixel offsets, then averages their colors. This statistical approach smooths jagged edges without a fixed kernel — the same random sampling that resolves the staircase artifact also begins to estimate the incoming radiance integral correctly. The sample count controls quality: more samples reduce variance (noise) but increase render time. This is the simplest form of Monte Carlo integration in a path tracer.

Examples

With 100 samples per pixel, cast 100 rays offset by rand() within the pixel’s unit square, average the resulting colors. Doubling samples halves standard deviation of error (sqrt(N) relationship).

Assessment

Why do 4 samples per pixel reduce aliasing but still show noise? At what sample count does a path tracer converge to a noiseless image?

“For a single pixel composed of multiple samples, we'll select samples from the area surrounding the pixel and average the resulting light (color) values together.”