BLENDER • LIGHTING AND CAMERAS

Depth of Field — Use depth of field and focus controls

Control selective focus in Blender to guide the viewer's eye and create cinematic realism in your 3D renders.

Historical Context & Motivation

Long before 3D rendering existed, photographers and cinematographers relied on depth of field (DoF) to direct viewers' attention, separate subjects from backgrounds, and convey narrative mood. The phenomenon is an inherent optical property of any physical lens system: objects at the focal distance appear sharp, while elements closer to or farther from the camera progressively blur. In traditional filmmaking, manipulating DoF through aperture, focal length, and sensor size became one of the most expressive tools available to the director of photography. As computer-generated imagery matured, rendering engines initially produced images that were perfectly sharp across the entire frame—a tell-tale sign of synthetic origin that undermined photorealism. The push to replicate real-camera behavior in virtual environments drove the development of DoF simulation in 3D software, culminating in the physically-based camera models we use in Blender today.

1840s
Early Photographic Optics
Petzval and Daguerre experiment with lens apertures, discovering that wider openings produce shallower planes of acceptable sharpness—laying the groundwork for creative focus control.
1941
Deep Focus in Cinema
Gregg Toland's cinematography for Citizen Kane demonstrates how extreme depth of field can be used as a storytelling device, keeping foreground and background equally sharp to emphasize spatial relationships.
1995
Post-Process DoF in CG
Early CG films begin using Z-depth passes and post-process blur to simulate depth of field, though results lack the optical accuracy of lens-based bokeh.
2013
Blender Cycles Camera DoF
Blender's Cycles renderer introduces ray-traced depth of field directly in the camera object, allowing physically accurate bokeh simulation with adjustable aperture blades, rotation, and ratio.
2020+
EEVEE Real-Time DoF
Blender's real-time EEVEE engine adds a post-process DoF pipeline with bokeh shapes and jitter, enabling interactive depth-of-field previews during scene composition.

The central question this lesson addresses is: how do you replicate the selective-focus behavior of a physical camera lens inside Blender's virtual camera system, and how do the underlying optical parameters—aperture size, focal length, focus distance, and sensor dimensions—interact to produce the depth of field you envision for your composition?

Core Principles & Definitions

Depth of field in Blender mirrors real-world optics: a region of acceptable sharpness exists around the focus distance, and everything outside that region gradually falls out of focus. The breadth of this sharp zone depends on three interdependent variables: the f-stop (aperture size), the focal length of the lens, and the distance between the camera and the subject. Understanding these principles empowers you to craft images that feel optically authentic rather than synthetically perfect.

1

Focus Distance

The distance from the camera at which objects appear perfectly sharp. In Blender, set via a numeric value or by picking a Focus Object whose origin the camera automatically tracks.
2

F-Stop (Aperture)

Controls the size of the virtual aperture. A lower f-stop (e.g., f/1.4) means a wider opening and shallower DoF; a higher f-stop (e.g., f/16) narrows the aperture and deepens the sharp zone.
3

Focal Length

The lens's magnification power in millimeters. Longer focal lengths (telephoto) compress depth and produce shallower DoF at the same f-stop, while wider lenses inherently extend the depth of field.
4

Bokeh

The aesthetic quality of the out-of-focus blur. Blender's Cycles lets you adjust aperture blade count, rotation, and ratio to shape bokeh highlights—circular, hexagonal, or anamorphic ovals.
5

Circle of Confusion

The maximum diameter at which a point of light is still perceived as sharp by the human eye. It depends on sensor size and viewing conditions, and it defines the mathematical boundary of the depth-of-field zone.
KEY TAKEAWAY
Think of depth of field like a spotlight on a theater stage: the focus distance is where you aim the light, and the f-stop controls how wide the beam is. A tight, narrow spot (low f-stop) isolates a single actor; a broad wash (high f-stop) illuminates the entire ensemble. The focal length then acts like the distance between the light fixture and the stage—farther back compresses the lit area.

Visual Explanation — The DoF Zone

Side-view diagram showing how objects positioned at the focus distance (green line) appear sharp, while those outside the near and far limits of the DoF zone progressively lose sharpness. Object C, beyond the far limit, exhibits significant blur.

In the diagram above, notice how the depth-of-field zone (the gradient band) is centered on the focus distance but is not symmetrically distributed. In practice, the region of acceptable sharpness extends roughly one-third in front and two-thirds behind the point of exact focus—a rule of thumb carried directly from photographic optics. When you set up your Blender camera, keep this asymmetry in mind: if your subject stands at the focal plane, slightly more of the background will remain acceptably sharp than the foreground, which can be exploited or countered depending on your compositional intent.

Mathematical Framework — Thin Lens DoF

While Blender handles the optical simulation internally, understanding the underlying mathematics helps you predict how parameter changes will affect the final image. The standard thin-lens depth-of-field equations are derived from the circle of confusion (CoC)—the largest blur disk that still appears as a point to the viewer. When a point of light from the scene falls outside the focal plane, it forms a disc on the sensor rather than a point; the disc diameter grows with distance from the focal plane and with the physical aperture size.

HYPERFOCAL DISTANCE
H = f² / (N × c) + f
where H = hyperfocal distance, f = focal length (mm), N = f-stop number, c = circle of confusion diameter (mm). When focused at H, everything from H/2 to infinity is acceptably sharp.
NEAR FOCUS LIMIT
D_n = (s × (H − f)) / (H + s − 2f)
where Dn = near distance limit and s = focus distance (subject distance from the camera). Objects closer than Dn will appear blurred.
FAR FOCUS LIMIT
D_f = (s × (H − f)) / (H − s)
where Df = far distance limit. When s ≥ H, Df becomes infinity—everything beyond focus distance is sharp.
TOTAL DEPTH OF FIELD
DoF = D_f − D_n
The total depth of field is simply the difference between the far and near limits. When Df is infinity, the DoF is technically infinite as well, meaning everything from Dn onward remains acceptably sharp.

In Blender's default camera, the sensor size is 36 mm (full-frame equivalent), which yields a common circle of confusion of approximately 0.03 mm. You do not need to enter this value manually—Blender derives it from the sensor size setting—but knowing it helps you reason about why a 50 mm lens at f/1.8 focused at 2 meters produces a DoF of only about 0.24 meters, while the same lens at f/11 yields roughly 1.7 meters of sharpness.

Blender's DoF Controls — Detailed Breakdown

Blender exposes depth-of-field settings through two complementary panels within the Camera's Object Data Properties. Understanding each parameter's role and its location in the interface is essential for efficient scene setup. The following diagram maps out the Blender UI hierarchy and the key properties you will adjust.

Blender's DoF controls are accessed through the Camera's Object Data Properties. Focus settings (green) determine where sharpness falls; Aperture settings (pink) determine how much blur occurs and its aesthetic shape. EEVEE requires an additional toggle in Render Properties.
Primary depth-of-field parameters in Blender's camera settings
ParameterLocationEffectTypical Range
Focus ObjectCamera > DoF > FocusLocks focus to an object's origin; overrides distance valueAny scene object or Empty
Focus DistanceCamera > DoF > FocusSets the distance in meters where perfect sharpness occurs0.1 m – 1000+ m
F-StopCamera > DoF > ApertureControls blur intensity; lower = more blurf/0.5 – f/128
BladesCamera > DoF > ApertureShapes bokeh highlights; 0 = circle, 5–8 = common lens shapes0 – 16 (Cycles only)
RatioCamera > DoF > ApertureStretches bokeh vertically for anamorphic look1.0 – 2.0 (Cycles only)
💡 Focus Object vs. Focus Distance
As a best practice, use a Focus Object (typically an Empty placed at your subject's position) rather than a manual distance. This approach lets you animate focus pulls by simply keyframing the Empty's location, and it automatically adjusts if the camera or subject moves. It is the closest analog to a real follow-focus rig on a film set.

Worked Example — Portrait Scene Setup

Let us walk through setting up a classic portrait-style render in Blender, where a character bust is sharply focused while the background environment softly melts away. This scenario mirrors the shallow depth of field look popularized by 85 mm portrait lenses at wide apertures.

Shallow DoF Portrait in Cycles
1
Step 1 — Set Camera Focal LengthSelect the Camera in your scene and open Object Data Properties (the camera icon in the Properties panel). Under the Lens section, set Focal Length to 85 mm. This telephoto perspective naturally compresses the background and provides a flattering perspective for portraits.
Focal Length = 85 mm
2
Step 2 — Enable Depth of FieldIn the same panel, expand the Depth of Field section and check the enable box. Until you do this, the camera renders everything in perfect focus.
DoF enabled ☑
3
Step 3 — Create and Assign a Focus EmptyAdd an Empty (Add → Empty → Plain Axes) and position it at the character's eyes—the typical focus target in portraiture. Back in the camera's DoF settings, click the eyedropper next to Focus Object and select the Empty. Blender will now compute the focus distance dynamically from the camera to this Empty.
Focus Object = Empty (at subject's eyes, ≈ 2.5 m from camera)
4
Step 4 — Set F-Stop for Shallow BlurUnder Aperture, set the F-Stop to 1.8. Using the DoF equations: H = 85² / (1.8 × 0.03) + 85 ≈ 133,890 mm ≈ 133.9 m. Near limit Dn ≈ 2.45 m, Far limit Df ≈ 2.55 m. Total DoF ≈ 0.10 m (about 10 cm).
F-Stop = 1.8 → DoF ≈ 10 cm — extremely shallow, perfect for isolating the subject
5
Step 5 — Shape the Bokeh (Optional)Set Blades to 7 for a natural heptagonal bokeh reminiscent of high-end portrait lenses. Leave Rotation at 0 and Ratio at 1.0 for spherical (non-anamorphic) rendering. Render a test frame (F12) and examine specular highlights in the background to verify the bokeh shape.
Blades = 7, Rotation = 0, Ratio = 1.0 → Heptagonal circular bokeh
6
Step 6 — Increase Samples for Clean DoFDepth of field in Cycles is ray-traced and introduces noise, particularly at very low f-stops. Under Render Properties → Sampling, increase the render sample count (512–1024 is a reasonable starting point) or enable the Denoiser (OptiX or OpenImageDenoise) to clean up the bokeh areas without excessive render times.
Samples ≥ 512 with Denoiser enabled → Clean, noise-free bokeh

Cycles vs. EEVEE — DoF Comparison

Blender ships with two primary render engines, and each implements depth of field through a fundamentally different mechanism. Choosing between them for DoF-heavy scenes involves weighing physical accuracy against interactive speed, which is a trade-off every visual artist navigates in production pipelines.

Depth of field implementation comparison between Cycles and EEVEE
FeatureCyclesEEVEE
DoF MethodRay-traced lens simulation; jitters rays across the aperture diskPost-process screen-space blur using a depth buffer
Bokeh AccuracyPhysically accurate; blade count, rotation, and ratio all affect shapeApproximated; circular by default, limited bokeh shaping
Render SpeedSlower; each sample scatters rays, requiring more samples for clean DoFVery fast; blur is applied in a single pass after rasterization
Edge ArtifactsNone; ray tracing naturally handles foreground/background transitionsPossible haloing or color bleeding at sharp-to-blurry transitions
Transparency / VolumetricsFully supported; DoF interacts correctly with transparent and volumetric objectsLimited; transparent objects may not blur correctly in all cases
Best UseFinal renders, portfolio pieces, cinematic qualityPrevisualization, real-time look-dev, animation playblasts
KEY TAKEAWAY
Think of Cycles DoF like painting with oil on canvas—slow, layered, and physically faithful—while EEVEE DoF is like applying a Gaussian blur filter in Photoshop over a flat image. Both achieve a similar visual result at a glance, but the Cycles approach correctly handles edge cases like bokeh from transparent materials and volumetric scattering through defocused regions. For final portfolio work, prefer Cycles; for iterative design explorations, EEVEE gets you 90% of the way instantly.

Connection to Advanced Techniques

Once you have mastered static DoF setup, the next frontier involves animated focus pulls (rack focus), compositing-based DoF using Z-depth passes, and advanced optical effects like tilt-shift simulation. These techniques extend the creative vocabulary established in this lesson and are essential for cinematic 3D animation work.

Current vs. advanced depth of field techniques in Blender
TechniqueThis LessonAdvanced Extension
Focus ControlStatic focus via object or distanceKeyframed rack focus between two subjects using animated Empties or drivers
DoF PipelineIn-camera DoF (Cycles/EEVEE)Z-depth pass rendered separately, DoF applied in the Compositor with Defocus node for post-render control
Lens SimulationStandard rectilinear thin lensTilt-shift via selective plane-of-focus rotation (achievable through compositing or add-ons)
Bokeh ShapeBlades, rotation, ratio in CyclesCustom bokeh images as textures in the Compositor Defocus node for fully bespoke highlight shapes

The Compositor's Defocus node deserves particular attention for advanced workflows. By rendering the scene without in-camera DoF and outputting a Z-depth pass, you can apply and adjust depth of field non-destructively after rendering. This approach is standard in VFX pipelines because it separates the expensive light-transport computation from the comparatively cheap blur operation, giving compositors precise control over the final look without requiring re-renders.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why reducing the f-stop from f/8 to f/1.4 produces a shallower depth of field, even when the focus distance and focal length remain unchanged. Reference the relationship between aperture size and the circle of confusion in your answer.
PROBLEM 2BASIC CALCULATION
A Blender camera is configured with a 50 mm focal length, f/2.0 aperture, and 36 mm sensor (CoC ≈ 0.03 mm). Calculate the hyperfocal distance H using the formula H = f² / (N × c) + f.
PROBLEM 3INTERMEDIATE
You are rendering a product shot of a wristwatch in Blender. The camera uses a 100 mm focal length at f/2.8, and the watch is positioned 0.6 meters from the camera. Calculate the approximate total depth of field using the near and far limit formulas. The sensor is 36 mm (CoC = 0.03 mm). Discuss whether this DoF is appropriate for the shot.
PROBLEM 4APPLIED
You are composing an architectural visualization interior in Blender where a foreground table (1.5 m from camera) and a background window (8 m away) should both remain sharp. The client requires a 35 mm lens for a natural field of view. Determine the minimum f-stop that would achieve this DoF range, and explain whether you would use Cycles or EEVEE and why.
PROBLEM 5CRITICAL THINKING
Compare and critically evaluate two DoF workflows: (A) enabling in-camera DoF in Cycles during rendering, versus (B) rendering without DoF and applying it in Blender's Compositor using the Defocus node with a Z-depth pass. Under what artistic and technical conditions would each approach be preferable? Consider render time, creative flexibility, edge quality, and interaction with transparency.

Lesson Summary

Depth of field in Blender replicates the optical behavior of physical camera lenses, allowing you to direct the viewer's attention through selective focus. The three primary controls are focus distance (where sharpness falls), f-stop (how much blur occurs), and focal length (which interacts with both field of view and DoF range). Lower f-stops and longer focal lengths produce shallower depth of field, while the circle of confusion defines the mathematical boundary between sharp and blurry.

In practice, use a Focus Object (Empty) for reliable, animatable focus targeting. Shape your bokeh with aperture blade count, rotation, and ratio in Cycles. Choose Cycles for physically accurate, artifact-free DoF in final renders, and EEVEE for rapid previsualization. For maximum post-render flexibility, consider the Compositor Defocus node workflow with a Z-depth pass, keeping in mind its limitations with transparent geometry and edge quality.

Varsity Tutors • Blender • Depth of Field — Use depth of field and focus controls