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.
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.
Focus Distance
F-Stop (Aperture)
Focal Length
Bokeh
Circle of Confusion
Visual Explanation — The DoF Zone
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.
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.
| Parameter | Location | Effect | Typical Range |
|---|---|---|---|
| Focus Object | Camera > DoF > Focus | Locks focus to an object's origin; overrides distance value | Any scene object or Empty |
| Focus Distance | Camera > DoF > Focus | Sets the distance in meters where perfect sharpness occurs | 0.1 m – 1000+ m |
| F-Stop | Camera > DoF > Aperture | Controls blur intensity; lower = more blur | f/0.5 – f/128 |
| Blades | Camera > DoF > Aperture | Shapes bokeh highlights; 0 = circle, 5–8 = common lens shapes | 0 – 16 (Cycles only) |
| Ratio | Camera > DoF > Aperture | Stretches bokeh vertically for anamorphic look | 1.0 – 2.0 (Cycles only) |
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.
85 mm. This telephoto perspective naturally compresses the background and provides a flattering perspective for portraits.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).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.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.
| Feature | Cycles | EEVEE |
|---|---|---|
| DoF Method | Ray-traced lens simulation; jitters rays across the aperture disk | Post-process screen-space blur using a depth buffer |
| Bokeh Accuracy | Physically accurate; blade count, rotation, and ratio all affect shape | Approximated; circular by default, limited bokeh shaping |
| Render Speed | Slower; each sample scatters rays, requiring more samples for clean DoF | Very fast; blur is applied in a single pass after rasterization |
| Edge Artifacts | None; ray tracing naturally handles foreground/background transitions | Possible haloing or color bleeding at sharp-to-blurry transitions |
| Transparency / Volumetrics | Fully supported; DoF interacts correctly with transparent and volumetric objects | Limited; transparent objects may not blur correctly in all cases |
| Best Use | Final renders, portfolio pieces, cinematic quality | Previsualization, real-time look-dev, animation playblasts |
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.
| Technique | This Lesson | Advanced Extension |
|---|---|---|
| Focus Control | Static focus via object or distance | Keyframed rack focus between two subjects using animated Empties or drivers |
| DoF Pipeline | In-camera DoF (Cycles/EEVEE) | Z-depth pass rendered separately, DoF applied in the Compositor with Defocus node for post-render control |
| Lens Simulation | Standard rectilinear thin lens | Tilt-shift via selective plane-of-focus rotation (achievable through compositing or add-ons) |
| Bokeh Shape | Blades, rotation, ratio in Cycles | Custom 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
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.