artween.com

Middle Grey — what a rendered image is actually doing

Entry 10 · Sampling

Adaptive Sampling

Spending the render budget where the variance is, not where it isn't.

Entry
10
Section
02 Sampling
By
Tom Beddoe
Read
2 min
Grid of blue squares with scattered pink and red highlights forming a checkered pattern
Plate 01 · SamplingSpending the budget where the variance is.Photo: Suzy Hazelwood / Pexels

By Tom Beddoe · Sampling · 2 min read

Where the samples go

A uniform sampler is democratic to a fault. It fires the same number of rays at the blank sky as at the sharp shadow edge under a table, at the flat diffuse wall as at the caustic pool on the floor. Most of those sky rays agree with each other immediately — the estimate converges fast, variance drops, and every extra sample after the third or fourth is returning almost nothing. Meanwhile the shadow terminator is still flickering.

Adaptive sampling breaks that contract. After an initial pass — typically a low, flat count across every pixel — the renderer measures how much the pixels disagree with each other. Variance is the formal quantity: the spread of the sample estimates around their current mean. High variance means the pixel hasn't settled; low variance means it probably has. The remaining budget is then redistributed toward the pixels that are still uncertain, and the flat sky gets nothing more.

The threshold is the one number the artist actually controls. Set it too tight and the system behaves like uniform sampling — every pixel keeps receiving samples because none of them quite reach the criterion. Set it too loose and smooth gradients converge early while genuinely difficult regions, like the edge of a shadow inside a glossy reflection, are left with less than they need. The firefly problem lives at this boundary: a single anomalously bright sample drags the variance measurement high and attracts more rays, which is the right response, but a clamp applied upstream can suppress that variance signal before adaptive sampling ever sees it, hiding the problem rather than solving it.

Specimen · Sampling1600 × 1000
A studio light head with a black flag cutting the beam
Noise is a budget, not a bug.

Convergence is detected locally, usually per-pixel, sometimes over a small neighbourhood to avoid isolated pixels declaring themselves done when their neighbours are still noisy. The minimum sample count matters too — there must be enough early samples to measure variance at all, because with only two or three rays in a pixel the variance estimate itself is unreliable.

The practical result is uneven sample counts across the frame, which is the whole point. Shadow boundaries, areas lit through small gaps, and surfaces with high-frequency texture accumulate many more samples than open sky or broad diffuse walls. Render time stays roughly the same or falls; noise is concentrated where it is hardest to remove rather than spread uniformly. Noise is a budget, and adaptive sampling is the discipline of not wasting it on pixels that have already made up their mind.

A clapper board face down beside a steel tape measure
On the tableSpending the budget where the variance is.Photo: StockHouse Films llc / Pexels

More in Sampling

Every entry in this section is listed on the Sampling page, and all twenty-four sit in the full register.