Depth of Field

 

So we’ve already gotten the animation part done, but when we want to show it to the rest of the world, surely we’ll want it to look pretty. So let’s talk about a few techniques we can do to spice up the render. And the first thing on that list is depth of field. Depth of field, for those who don’t know, is when the camera gets blurry for everything except for things at a specific distance from the lens. To emulate this, all we have to do is enter camera view, select the camera and go into the camera data settings. There we have a convenient depth of field checkbox that we can enable. However, you may not notice anything right away. That’s because depth of field is only visible in material preview or rendered view in the viewport. You can access these viewing modes in the top right-hand corner of the viewport, or you can press the Z hot key to access the pie menu.

By default, the depth of field is set to focus at a distance specified as a number. Once you have material preview on, you can try moving this value left and right to see how it affects our scene. As you can see, depth of field allows you to focus on a specific distance from the camera, but this might make it difficult to focus on a moving target for several shots.

Even if we key frame the number for each shot, it’d be a bit tedious. So my recommended technique for depth of field is to use the option above focus distance, the focus object parameter. This allows you to automatically set the focus distance to the location of the object you have set. So maybe we can put our character rig object in this parameter so that our camera focuses on our character at all times.

But if we do that, it’ll prevent us from controlling and fine tuning the depth of field as we like without moving the character. So I prefer using an empty as the focus object, which we can key frame easily. To add an empty, simply go into the add menu and select empty. I prefer sphere empties so it’s easy to spot the empty in our scene.

Let’s rename this empty to DOF for depth of field. And then we can easily set the focus object of our scene camera to the DOF empty. From there it becomes very easy to do a simple pass where you move the empty to wherever you want the camera to focus. Pro-tip: you can press shift right-click to snap the 3D cursor to the closest surface beneath your mouse cursor. Then snap your selected object to the 3D cursor with object -> snap -> selection the cursor. For hot key users, you can also use shift S to access the snap menu. Repeat this process for the whole animation, making sure that the DOF empty is on or near any object you want to focus on. For those who are curious while there are settings for the depth of field properties in the render settings tab, the default max size of 100 is usually fine.

In the next video, we’ll be discussing lighting.