Depth of Field in Blender

Depth of field effect visible in a Blender render

Depth of Field is a photography effect you’ve seen even if you didn’t know you were seeing it. It’s also known as “Background Blur.” It’s the effect that occurs when a camera focuses on objects at a certain distance and objects in front of or behind the area of focus are blurry. We can create this powerful artistic effect can in Blender using both Eevee and Cycles. Here’s how.

Oh… I also have a YOUTUBE VIDEO on Depth of Field.

Camera Aperture Settings

To create Depth of Field (DOF) in Blender, we will need a camera. With the camera selected, we find the Depth of Field settings in the Camera Properties Panel. Below the Lens Settings is a check box to turn on Depth of Field. We can expand the section to see more settings.

The Depth of Field settings found in Blender's Camera Properties Panel.
The Depth of Field settings in the Camera Properties Panel.

The settings are fairly simple and most of them we don’t need to worry about. The Focus Distance is a distance from the camera at which the camera will fully focus. Objects closer or farther away than this distance will be out of focus and blurred.

It can be difficult to know how far away you want the focus to be in distance so the Focus on Object setting is useful. With this, we can either click on the box and choose from the objects in our scene or use the Eyedropper tool to select an object we want to focus on. Choosing the object will automatically align the Depth of Focus distance to the distance of the selected object.

Try Scatter – it’s awesome!

F-Stop: How Blurry Do We Want It?

By expanding the “Aperture” tab under Depth of Field, we find four settings. The first and most important setting is “F-Stop.” F-Stop is a measurement used in photography. According to PhotographyLife.com, the F-Stop is “the ratio of the lens focal length to the diameter of the entrance pupil.” The definition isn’t that important to us. What’s important is what the F-Stop setting does to our image in Blender.

A smaller F-Stop number will increase the blurry effect of the out-of-focus objects. A larger number will reduce the blurriness. We will only see the effect in Material Preview or Render Preview Modes (not in Object View). Below is an example of a low F-Stop vs a higher F-Stop.

F-Stop .2
F-Stop 3.0

Aperture Settings: Blades, Rotation and Ratio

Below the F-Stop setting, we see three more settings for “Blades,” “Rotation” and “Ration.” These are very technical settings to further simulate a real-world camera. I generally haven’t had to use them, but I’ll try to explain them as best I can (but I’m not a camera expert).

A real-world camera’s aperture is a series of blades which overlap as they rotate to make a roughly circular aperture opening. Cameras can have different numbers of blades and so can Blender’s camera.

Blades on a real-world camera aperture.

The term “Bokeh” refers to the quality of the blurry effect caused by a camera’s Depth of Field – especially with lights and reflections. More blades on a camera’s aperture creates a smoother Bokeh effect. Adjusting only the blades probably won’t make a noticeable effect. But combining a “Blades” adjustment with the “Ratio” setting below it can change the look of the blur.

The “Bokeh” effect is very visible with the out-of-focus lights in this image.

The “Rotation” setting controls a rotation of the blades of the camera. I’ve played with this setting a lot and can’t seem to notice any difference when I adjust it. But I’m sure there are smarter people who understand its purpose and when it would be useful.

The “Ratio” changes the distortion effect of the “Bokeh.” It defaults to 1. Lowering the setting will cause a horizontal distortion of the blur. Increasing it above 1 will cause a vertical distortion of the blur.

Animating Depth of Field

Transitioning the Depth of Field during an animation can create a great effect. The Depth of Field in Blender can be animated a couple of ways. We could manipulate the Focus Distance add keyframes to the slider, but that’s the hard way.

The method which gives us the best control is to add an empty to our scene and place it where we want the Depth of Field focus to begin in the scene. Using the Focus Object setting, focus the Depth of Field on the empty. Even though empty objects don’t appear in our rendered images, they can be used as a focal point for the camera.

Then as we want the Depth of Field to move, we simply animate the movement of the empty object. We can also animate the value of the F-Stop to have the effect fade in or out.

How to Animate the Empty Object

I will soon link to a full tutorial on animating with keyframes, but for now here is what we do to animate the empty object:

Go to the frame in the animation timeline when we want the Depth of Field to begin its transition. Select the empty and use the shortcut “I” to add a keyframe. Then immediately press “L” to indicate we want to add the keyframe to the empty’s location.

Next, move to the frame where we want the focus to be fully transitioned. Move the empty to the new area where we want the camera to focus. Again press “I” to add a keyframe and then “L” to indicate location. Play the animation and the empty will move (along with the camera’s focus) to the new area where we want it.

Processing…
Success! You're on the list.

Published by Brandon's Drawings

I am a digital artist in Vacaville, CA. I originally created this site to display my own digital art. Now I also use it to teach others about digital art - mostly with the free 3D software known as Blender.

Leave a Reply