Cinema 4D / BodyPaint 3D Program Documentation Tutorials Camera and Render Settings Tutorial
Function available in CINEMA 4D Visualize, Broadcast, Studio

Depth of Field

The depth of field is defined using the Camera object’s settings. Depth of field is the region of a rendered image in which objects will appear blurred because their distance from the camera (either far or near) causes them to be out of focus.

The distance at which the camera should focus is defined by the Focus Distance value in the Camera object’s Object tab.

Tip:
If you click on the arrow next to the Focal Distance value, the cursor will turn into a cross-hair and you can click on objects in the Viewport on which you want to focus.

You can also define a blur in front of (Front Blur) or behind (Rear Blur) the Target Distance. The DOF Map Front Blur’s Start and End values define the distance between the Camera object and the Target Distance at which objects should be blurred. The Start value defines the distance from the camera at which the blur effect should start to take affect. The blur effect will reach its maximum strength when it reaches the End value. The same priciple applies to the Rear Blur effect except that it applies to the region behind the Target Distance (Note: the distance settings will only have an effect if the gradients, which are mentioned below, are enabled). Enabling either of these opions will add handles (with corresponding reference lines) so you can better visualize the distances defined.

However, in order for these options to actually have an effect additional settings must be made in the Render Settings menu. The depth of field effect can be added in one of two ways: You can render it in the image itself or you can create a separate bitmap for compositing purposes (post-production), which contains the depth of field data. The latter can be achieved using the Cinema 4D Multi-Pass option.

First we will describe how to include the depth of field effect directly in a rendered image. Add the Depth of Field effect by selecting it from the Render Setting’s Effects menu. In the Basic tab’s menu, define the type and strength of Blur you want to add. Generally speaking you can leave the settings as they are and simply modify the value.

If, for example, a Background object is textured with an image the Background Blur option can be enabled so it can be controlled separately (if Distance Blur is enabled instead of Background Blur, the background image will be treated as an infinitely distant object by the depth of field effect). You can use the Gradient options to adjust the transition from focused to blurred regions as defined by the Camera object. As a rule, the Use Gradients option should be enabled to ensure a natural-looking transition between focused and blurred regions.

Lens details

In a real-world setting strong specular lights or refelections within a blurred region result in characteristic artifacts from which the shape of the camera system’s aperture can be deduced. This effect can also be simulated in Cinema 4D. To do so, select one of the available shapes from the Lens tab’s menu. The intensity and sharpness can then be adjusted using the available settings. The Lens Rotate setting also lets you rotate the lens shape.

Tint

You can also tint the scene in correlation with the depth of field effect. This can be useful when rendering outdoor scenes, e.g., when rendering a horizon that has a gray or blue tint. If the Use Tint option is enabled, a gradient can be defined for the front and rear blur, respectively.

General information for applying Depth of Field

The following example demonstrates the use of depth of field when used in our red-and-white room. The right half of the image shows the scene as viewed from the top in wireframe mode. The focused and blurred regions are clearly marked by the yellow lines. The region around the television is in focus and the regions approaching the camera and the rear door are increasingly blurred.

When rendered in this fashion the room is given a slight "miniaturized" look. This is because the viewer is presented a depth of field effect usually present in close-up macro views. Hence, you should use such effects sparingly and make sure the effect is appropriate for the size of the respective room - which will avoid making a large dining hall look like a doll house.

Depth of field with the Physical Camera

This is an alternative form of depth of field made available by the Physical Renderer and also works for transparencies and other effects, based on the physical properties of the camera. To use this depth of field, set the Renderer to Physical and enable its Depth Of Field option.

Since certain functions are influenced by their distance from the camera, light sensitivity and exposure times, as in the real world, we recommend that you make a note of the size of objects and their respective distance from the camera when creating a new Project. You should also keep in mind that the Physical Camera in fact uses features such as the complex effects of F-Stop, exposure, film sensitivity and aperture. Click on the following icon to load a scene with which we can test these options:


Render the Scene. Then select the Camera. Click on the Physical tab in the Attribute Manager where you will find the F-Stop (f/#) parameter, which is currently set to 8. This parameter controls the F-Stop effect. Set the value to 2 and render the Project. The result will be quite different from the previous render: elements nearer the camera as well as those far away are now blurred. The mid-range elements are rendered clearly. The image is also brighter than the previous render, which is due to the effect of the modified F-Stop value.

The F-Stop value is the value derived from the division of the defined F-Stop value and the diameter of the camera front lens. This in turn defines the region in front of the lens that will appear in focus, i.e., the region in between the near and far depths of field. Hence, when F-Stop is mentioned in this tutorial, it also has to do with aperture. Set the F-Stop value to 1 and render the image again. You will see that the image is even brighter and the blurriness in the distance as well as near the lens has increased. Compare this result with a value of 22 and you will notice extreme differences in blurriness and brightness.

The Physical Camera simulates the correlation between different photographic elements, which means that there is in fact a direct correlation between F-Stop and exposure. This becomes evident if, for example, you set the Shutter Speed (s) from 1/30 s to 1/8 s.

The rendered result shows that a longer exposure affects the brightness of the image. If we changed the Shutter Speed settings to make film more sensitive to light, the results would be comparable: a brighter image.

If these correlations are too complex for now, you can make things easier by disabling the Exposure function. This will result in a uniform brightness, independent of F-Stop and Shutter Speed values.