Sub topic 4
Samples, denoising, and render time
This chapter explains how the sample count controls image noise and render time in Blender. It also covers how denoising and adaptive sampling reduce the cost, and how to choose settings for a still image and for an animation. It assumes you can open the Render properties, switch the render engine, and render a frame with F12. Python knowledge helps for the last example but isn't required.
What a sample is
A path-tracing engine such as Cycles estimates the color of each pixel by firing random light paths through it. One path is one sample. A single sample is a poor estimate, so the engine averages many samples per pixel. The random variation that remains in the average appears as noise: grain, speckles, and bright isolated dots.
Noise falls slowly as samples increase. The error shrinks roughly with the square root of the sample count. This leads to two rules:
- Quadrupling the samples about halves the noise.
- Render time grows roughly in proportion to samples, so quadrupling the samples about quadruples the time.
| Samples | Relative noise (approx.) | Relative time (approx.) |
|---|---|---|
| 64 | 1.41 | 0.5 |
| 128 | 1.00 | 1 |
| 512 | 0.50 | 4 |
| 2048 | 0.25 | 16 |
These figures are a model, not a measurement. Fixed costs such as scene loading and BVH building (the acceleration structure used to find what a ray hits) do not scale with samples. Short renders therefore show less than linear growth in time.
Because of this curve, doubling the samples again and again is a poor way to remove the last of the noise. Denoising and adaptive sampling usually give more improvement for the time.
Where samples are set
Samples live in Render properties, under Sampling. Cycles keeps two separate values:
- Viewport samples (
scene.cycles.preview_samples) control the interactive Rendered view in the 3D Viewport. - Render samples (
scene.cycles.samples) control F12 renders, animation renders, and command-line renders.
A common mistake is to judge the final result from the viewport. The viewport value is usually lower, and it can have different denoising settings.
EEVEE has its own, much smaller sample count (scene.eevee.taa_render_samples). EEVEE is a rasterizing engine, so its samples average out anti-aliasing and soft effects, not random light paths. The noise and time trade-offs below apply mainly to Cycles. Workbench has no meaningful noise setting.
Denoising
A denoiser is a filter that looks at a noisy image and produces a cleaner estimate of what the fully converged image would look like. Cycles offers these denoisers:
- OpenImageDenoise (OIDN) runs on the CPU, and recent versions can also use some GPUs. It is the default and works on any hardware.
- OptiX runs on NVIDIA RTX GPUs. It is fast, which suits viewport use.
Denoising is controlled by use_denoising and denoiser. By default, the denoiser also receives auxiliary data: the albedo (surface color without lighting) and the normal (surface direction). With these, it can tell real texture detail from noise, so it blurs less. The setting is denoising_input_passes. Use 'RGB_ALBEDO_NORMAL' for the best detail.
flowchart TDDo not use the block above. The diagram follows.
What denoising gets wrong
A denoiser makes a statistical guess, so it can fail in these ways:
- Fine textures, such as small text or thin patterns, can smear when the sample count is too low for the denoiser to see them.
- Very low sample counts leave large blotches that the filter turns into smooth but wrong patches.
- Animations can show flicker or crawling patterns, because each frame is denoised independently and the guess differs slightly from frame to frame.
A practical approach is to use enough samples that the noisy image is roughly recognizable, then let the denoiser finish the job. Preview a still at full resolution before committing to a long animation.
Adaptive sampling
Not every pixel needs the same number of samples. A flat gray wall converges quickly, while a pixel inside a glass object seen through reflections may need many. Adaptive sampling (use_adaptive_sampling) tests each pixel during the render and stops sampling it once its estimated noise is below a threshold.
The relevant settings are:
adaptive_thresholdis the noise level at which a pixel stops. The default is 0.01. Lower values mean cleaner results and longer renders. A value of 0 lets Blender choose automatically.adaptive_min_samplesis the minimum number of samples per pixel before the test starts. A value of 0 lets Blender choose automatically.samplesbecomes a maximum, not a fixed count. Easy pixels stop earlier, and hard pixels may use all of it.
With adaptive sampling on, a high maximum is cheap to set, because the render only spends time where noise remains. That makes the threshold the main quality control, and the sample count a safety limit.
Time limit
time_limit (in seconds, 0 means no limit) stops the render after a fixed time per frame. It is useful for predictable animation budgets, for example 30 seconds per frame across 240 frames. The drawback is inconsistent quality: a frame with a complex view will be noisier than a simple one. For deliberate quality control, prefer the noise threshold, and use the time limit only as a ceiling.
Choosing settings for a still and for an animation
For a still image:
- Enable denoising with OIDN and the albedo and normal passes.
- Enable adaptive sampling with the default threshold.
- Set the maximum to something generous, such as 512 to 2048.
- Render a small crop first (Render Region, Ctrl+B in the camera view) to inspect hard areas such as glass, shadows, and caustics.
- If noise remains in specific places, lower the threshold or raise the maximum, then re-render the region.
For an animation:
- Aim for the lowest settings that look clean after denoising. Cost is multiplied by every frame, so 10 seconds saved per frame saves 40 minutes over 240 frames.
- Render a few representative frames, not just frame 1. Scenes with more light bounces or large reflective surfaces cost more.
- Check for flicker by rendering a short range, such as 10 frames, and playing it back.
- Keep the seed behavior in mind. By default, every frame uses the same random pattern, so the noise stays fixed on screen like a dirty window. The setting
use_animated_seedchanges the pattern each frame, which looks like natural film grain but can interact badly with denoising. Test both on a short range.
Other factors that affect render time
Samples are only one lever. These also change time:
- Resolution: pixel count scales time directly. Halving the width and height cuts the cost to about a quarter. See the chapter on Output properties.
- Light bounces: lower
max_bouncesfor faster, slightly less accurate lighting. - Clamping:
sample_clamp_indirectlimits the brightness of a single indirect sample, which suppresses fireflies (isolated bright pixels) at the price of some lost brightness. - Device: GPU rendering is usually much faster than CPU when the scene fits in GPU memory.
Measuring instead of guessing
Time a test render before starting a long job. The script below sets the sampling options and renders at 25% resolution to measure the cost per frame. Run it from the Scripting workspace or with blender -b scene.blend --python timing.py.
import time
import bpy
scene = bpy.context.scene
scene.render.engine = 'CYCLES'
cycles = scene.cycles
cycles.samples = 512
cycles.use_adaptive_sampling = True
cycles.adaptive_threshold = 0.01
cycles.adaptive_min_samples = 0
cycles.time_limit = 0
cycles.use_denoising = True
cycles.denoiser = 'OPENIMAGEDENOISE'
cycles.denoising_input_passes = 'RGB_ALBEDO_NORMAL'
original_percentage = scene.render.resolution_percentage
scene.render.resolution_percentage = 25
start = time.perf_counter()
bpy.ops.render.render(write_still=False)
elapsed = time.perf_counter() - start
scene.render.resolution_percentage = original_percentage
frames = scene.frame_end - scene.frame_start + 1
full_frame_estimate = elapsed * 16
print(f"Test render at 25%: {elapsed:.1f} s")
print(f"Estimated full-size frame: {full_frame_estimate:.1f} s")
print(f"Estimated animation ({frames} frames): {full_frame_estimate * frames / 60:.1f} min")The factor of 16 comes from a 25% scale on each side, which gives 1/16 of the pixels. The estimate ignores fixed costs, so it will be slightly high. Treat it as a planning number.
Common errors
- Noise is the same in every frame of an animation and looks like a texture on the screen. This is the fixed seed. Enable
use_animated_seedif you want grain that moves, or leave it fixed on purpose. - Everything looks smeared and plastic. The denoiser is working from too little data. Raise the samples, or make sure the albedo and normal passes are in use.
- A render stops far below the sample maximum. This is adaptive sampling working as intended. Lower the threshold if the result is too noisy.
- Render time is much higher than expected. Check the resolution percentage, the viewport versus render sample fields, and whether the device is set to CPU in Preferences.
- Changing samples in EEVEE has little effect on noise. EEVEE does not produce path-tracing noise in the same way.
Exercise
A Cycles frame takes 60 seconds at 256 samples with adaptive sampling off, and still looks too noisy. A colleague proposes raising the samples to 1024. Using the noise and time model in this chapter, what are the expected effects, and what would you try first instead?
Show answer
Quadrupling the samples (256 to 1024) roughly halves the noise but about quadruples the time, so the frame takes about 240 seconds. Try enabling denoising (OIDN with albedo and normal passes) and adaptive sampling first. Denoising removes much of the remaining grain without a 4x cost, and adaptive sampling spends the samples only on pixels that still need them. Then test a cropped region with Render Region to check detail, and raise the sample maximum only if specific areas remain noisy.
Exercise
You render a 240-frame animation with a fixed seed and denoising enabled. The result shows a still, grainy pattern that does not move with the camera. What causes it, and what setting changes it?
Show answer
The same random sample pattern is used for every frame, so the residual noise stays fixed in screen space. Enable use_animated_seed (Animate Seed in the Sampling Seed options) to vary the pattern per frame. Then render a short range and check that the denoiser does not introduce flicker.