In this basic Blender tutorial, we'll learn how to set the depth of field for the virtual camera, ensuring only one specific point in the scene remains in focus while blurring areas closer or farther from that point.



Video Transcript

Hello everyone! In this basic Blender tutorial, we'll learn how to set the depth of field for the virtual camera, ensuring only one specific point in the scene remains in focus while blurring areas closer or farther from that point.

We'll also see how to preview the camera's focus point and the blur applied by the depth of field directly in the 3D Viewport.

This tutorial was created using Blender version 4.3 and focuses solely on the Camera object's properties, not the Defocus option in Compositing, which I may cover in a future video. If you're interested in more tutorials on Blender, Substance Painter, or Unity, now is a great time to subscribe to the channel and turn on notifications!

In the scene I'm using for this tutorial, there is, of course, a virtual camera that frames several elements in the scene.

In the 3D view, all elements are perfectly in focus, and the same result can be achieved by rendering the scene.

Blender allows us to implement Depth of Field in two ways, both accessible from the Depth of Field section in the Object Data Properties tab of the virtual camera.

The first method keeps the elements of the scene in focus at a certain distance from the virtual camera. This method is implemented by adjusting the Focus Distance parameter.

Adjusting this value right now presents two issues. The first is that we don’t know which point in the scene corresponds to the set distance. The second issue is that we don’t have a preview of the effect in the 3D Viewport.

To solve the first issue, we can enable the Limits option in the Viewport Display section of the Object Data Properties tab of the camera. This option displays the camera's Clip Distances with a line segment and the focus point with a pair of crossed lines, as shown in the video.

Now, it’s easier to set the focus point because we can see, in real time, where this point is located while adjusting the Focus Distance parameter.

To preview the blur effect introduced by the depth of field in the Camera View, we need to open the Viewport Shading menu in the 3D View and enable the Depth of Field option. In Render mode, the effect is visible even if the Depth of Field option is disabled in the Viewport Shading menu, which then applies in Solid mode.

Before analyzing the Depth of Field parameters of the camera object, let’s look at the second method for setting the focus distance: Focus on Object.

Intuitively, this option allows us to always keep an object in focus, even if it’s an invisible one, such as an Empty added to the scene as an easily identifiable reference point. The focus point will be the object’s Origin, so this must be set correctly to achieve the desired result, as I'm showing on video.

This option is very useful both in scenes where the object is stationary, as it allows us to quickly set the focus point, and in animations, as the camera will always keep the desired object or point in focus, regardless of the movements of the camera or the object.

A strength of the Focus Distance method is that the parameter value can be animated, enabling us to create animations where the focus shifts from one object to another, as shown in the example on the screen.

This effect can also be achieved by using an Empty as the Focus Object and moving the Empty. Ultimately, the choice between one method or the other depends on your personal preference!

Now, let’s take a look at the parameters that allow us to define how the depth of field is implemented for the virtual camera.

The first parameter is called F-Stop, and it adjusts the intensity of the blur for the out-of-focus areas of the scene. The lower this value, the stronger the depth of field effect will be. As with most Blender parameters, this value can be animated, allowing you to focus attention on an element of the scene during an animation (or vice versa).

The other three parameters are used to implement the Bokeh effect. This effect is due to the shape, orientation, and construction of the aperture blades in real-world camera lenses.

In traditional photography, the shape of out-of-focus elements is heavily influenced by these characteristics, which are simulated in Blender using the Blades, Rotation, and Ratio parameters.

The effect is visible in the final render on all rendered objects. To make it more evident for these examples, I will use a scene with a sphere that has an emissive material against a black background, placing the sphere in an out-of-focus area.

The Blades parameter refers to the number of aperture blades in real-world camera lenses and affects the alteration of the shape of blurred objects. The effect is visible only if this value is 3 or greater, resulting in polygons with 3 or more sides.

In the video, I’m showing renderings created by adjusting the value of this parameter. As you can see, if Blades is set to 0, the sphere’s glow will have a circular shape. However, with values of 3 or higher, the result will be a polygon with the corresponding number of sides. The renderings were made with a low number of Samples and the Denoise option enabled, so the initial renders appear very noisy, but the final images are much smoother and clearly blurred.

As the Blades value increases, the polygon increasingly approximates a circle, but at that point, it may be better to simply set the value to 0 for a perfectly circular effect. In fact, real camera lenses often have 6 or more aperture blades to approximate a circle and avoid polygonal Bokeh shapes.

The Rotation parameter allows you to rotate the shape produced by the Bokeh effect when Blades is set to a value of 3 or higher. The rotation can be counterclockwise or clockwise, depending on whether the value increases or decreases, including with negative values.

In the video, I’m showcasing an animation created by animating the Rotation value from 0 to 180 over the course of 250 frames, with Blades set to 3.

Finally, the Ratio parameter allows you to distort the polygons created by the Bokeh effect, elongating them horizontally if the value is less than 1 and vertically if the value is greater than 1. Therefore, the default value of 1 does not introduce any distortion to the shapes.

That’s it for this overview of the Depth of Field settings for Blender cameras, both in the 3D Viewport and in rendering! I hope you found it helpful. See you next time!

Search Tutorials

Enter a phrase or multiple comma-separated keywords to search.

This is a personal website and does not constitute a sales channel. The pages dedicated to 3D models document a selection of my work and do not contain offers, prices, purchasing procedures, or commercial links. I am not currently accepting requests for custom work, consulting, or other professional collaborations.


EXTENDED PRIVACY AND COOKIE USAGE POLICY