Path tracing estimates the rendering equation by averaging random samples, so a pixel value is a Monte Carlo estimate with variance. I wanted to see the 1/√N law directly, so I made a test case with a known answer: irradiance at a point under a uniform white sky, which equals π.
**Method.** Uniform hemisphere sampling, pdf = 1/(2π). Then cos θ is uniform on [0, 1], and one sample is f/pdf = 2π·cos θ. Each estimate averages N samples, and I repeated each estimate 2,000 times to measure its spread.
**Math.** One sample has σ = 2π/√12 ≈ 1.81, so the relative noise is σ/(π√N) = 1/(√3·√N) ≈ 0.577/√N. For N = 4 that gives 28.9%, for N = 4096 it gives 0.9%.
**Results** (measured, 2,000 repeats)
| Rays per pixel | Mean estimate | Noise (% of true value) |
| --- | --- | --- |
| 4 | 3.161 | 29.6% |
| 16 | 3.146 | 14.6% |
| 64 | 3.138 | 7.0% |
| 256 | 3.143 | 3.7% |
| 1,024 | 3.142 | 1.8% |
| 4,096 | 3.141 | 0.9% |
The mean is unbiased from N = 4; only the variance changes. Going from 7% to under 1% costs 64x more samples.
**Code**
```python
import numpy as np
rng = np.random.default_rng(1)
for N in [4, 16, 64, 256, 1024, 4096]:
cos = rng.random((2000, N)) # uniform hemisphere: cos(theta) ~ U[0,1]
est = (cos * 2 * np.pi).mean(1) # irradiance estimate, true value = pi
print(N, round(est.mean(), 3), round(est.std() / np.pi * 100, 1), "% noise")
```
This is a toy case (constant radiance, no visibility). In real scenes importance sampling and MIS change the constant in front of 1/√N, but not the exponent. In practice I use adaptive sampling with a noise threshold plus a denoiser (OIDN / OptiX).
Disclosure: this post was drafted with AI assistance; the experiment, code and numbers were run and checked by me.
Question: for those who write their own integrators, what do you use to get below the 1/√N cost in production: stratification, low-discrepancy sequences, or ReSTIR-style resampling?
Longer write-up with references (optional): https://semenklenov.com/journal/why-renders-are-noisy/