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.

A three-dimensional axis with a modeled cube and movement controls.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

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?

SECTION 2

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.

SECTION 3

Visual Explanation — The DoF Zone

Depth of Field — Camera Side ViewOptical AxisCameraDepth of Field Zone (Acceptable Sharpness)Near LimitFar LimitFocus DistanceObject A(slightly soft)Subject(sharp)Object C(blurred)Cone oflightIn focusMarginalOut of focus
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.

SECTION 4

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=f2/(N×c)+fH = 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

Dn=(s×(H−f))/(H+s−2f)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

Df=(s×(H−f))/(H−s)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=Df−DnDoF = 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.

SECTION 5

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 Camera DoF Settings MapCamera ObjectDepth of Field ☑ EnableFocus SettingsFocus Object(pick any scene object)Focus Distance(manual distance in meters)Keyframeable ✓Aperture SettingsF-StopRange: 0.01 – 128 (default 2.8)Blades0 = perfectly circular bokeh3–16 = polygonal shapesRotationRotates the blade polygon (radians)Ratio1.0 = circular; >1 = oval/anamorphicCycles only: Blades, Rotation, RatioEEVEE NoteUses post-process blur; enablevia Render Properties → DoF
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.
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)

Primary depth-of-field parameters in Blender's camera settings

💡

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.

SECTION 6

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. 1

    Step 1 — Set Camera Focal Length

    Select 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. 2

    Step 2 — Enable Depth of Field

    In 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. 3

    Step 3 — Create and Assign a Focus Empty

    Add 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. 4

    Step 4 — Set F-Stop for Shallow Blur

    Under 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. 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. 6

    Step 6 — Increase Samples for Clean DoF

    Depth 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

SECTION 7

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.

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

Depth of field implementation comparison between Cycles and EEVEE

✦

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.

SECTION 8

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.

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

Current vs. advanced depth of field techniques in Blender

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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

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.
Show answer
A lower f-stop corresponds to a larger physical aperture opening. Light rays entering through a wider aperture diverge more rapidly on either side of the focal plane, causing out-of-focus points to project as larger circles of confusion on the sensor. Since the depth of field is defined as the range where the circle of confusion remains smaller than a threshold (typically 0.03 mm for a 36 mm sensor), a bigger aperture pushes more of the scene beyond this threshold, narrowing the zone of acceptable sharpness. Mathematically, the hyperfocal distance H = f²/(N × c) + f decreases as N (the f-stop) decreases, which in turn tightens both the near and far focus limits around the subject distance.

Question 2: BASIC 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.
Show answer
Substituting the given values: H = 50² / (2.0 × 0.03) + 50 = 2500 / 0.06 + 50 = 41,666.67 + 50 = 41,716.67 mm ≈ 41.7 meters. This means that if you focus the camera at approximately 41.7 meters, everything from about 20.9 meters to infinity will be acceptably sharp. For subjects much closer than 41.7 meters—say at 3 meters—the depth of field will be extremely narrow because the subject distance is far less than the hyperfocal distance.

Question 3: INTERMEDIATE

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.
Show answer
First, calculate H: H = 100² / (2.8 × 0.03) + 100 = 10,000 / 0.084 + 100 = 119,147.6 + 100 ≈ 119,248 mm ≈ 119.2 m. With s = 600 mm (0.6 m), near limit DnD_n = 600 × (119,248 − 100) / (119,248 + 600 − 200) = 600 × 119,148 / 119,648 ≈ 597.5 mm ≈ 0.5975 m. Far limit DfD_f = 600 × (119,248 − 100) / (119,248 − 600) = 600 × 119,148 / 118,648 ≈ 602.5 mm ≈ 0.6025 m. Total DoF ≈ 602.5 − 597.5 = 5 mm. This extraordinarily shallow DoF means only about 5 mm of the watch face will be perfectly sharp—ideal for isolating a single detail like the brand logo, but insufficient to keep the entire dial sharp. To broaden the DoF, increase the f-stop to f/8 or f/11, or pull the camera back and use a wider lens.

Question 4: APPLIED

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.
Show answer
To keep objects from 1.5 m to 8 m sharp, you need a DoF zone spanning at least 6.5 meters. A practical approach is to focus at approximately 2.3 m (using the harmonic mean approximation for optimal focus placement between near and far subjects). Calculate the required hyperfocal distance such that DnD_n ≤ 1.5 m. Using the near limit formula rearranged: H ≤ s × (s − f) / (s − DnD_n) + f. With s = 2300 mm, DnD_n = 1500 mm, f = 35 mm: H ≤ 2300 × 2265 / 800 + 35 ≈ 6,513 mm ≈ 6.5 m. Then N = f² / ((H − f) × c) = 35² / (6478 × 0.03) ≈ 1225 / 194.3 ≈ 6.3. So an f-stop of approximately f/6.3 or higher (f/8 for a standard stop) is needed. For architectural visualization, Cycles is the stronger choice because it accurately renders reflections in glass, interior volumetric lighting from the window, and produces artifact-free DoF transitions—all critical for a professional archviz deliverable.

Question 5: CRITICAL 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.
Show answer
Workflow A (in-camera Cycles DoF) traces rays through the aperture disk, producing physically correct bokeh with accurate blade shapes, proper interaction with transparent and refractive surfaces, and seamless transitions. However, it requires significantly more samples to resolve noise in the bokeh regions, increasing render times by 30–100% depending on scene complexity. It is the preferred choice when optical accuracy is paramount—for instance, scenes featuring glass objects, water, or volumetrics in defocused areas. Workflow B (Compositor Defocus node) separates the blur from the render pass, allowing non-destructive adjustment of focus distance and blur amount after rendering. This drastically reduces render time since the base image needs no DoF sampling. However, the Z-depth pass stores a single depth value per pixel, which fails at transparent or overlapping geometry—a glass vase in the foreground, for example, may not blur correctly because its depth is ambiguous. Edge artifacts (haloing) can also appear where sharp foreground objects meet blurred backgrounds, because the screen-space blur lacks information about occluded pixels. Workflow B excels in animation pipelines where multiple DoF variations must be tested without re-rendering, or in scenes where all objects are opaque and well-separated in depth.

SUMMARY

Lesson Summary

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