How to Use Depth of Field in After Effects

Depth of field in Adobe After Effects adds cinematic realism to motion graphics and visual effects by blurring elements outside a designated focal plane. This guide covers how to set up 3D layers, create a camera, enable depth of field, adjust critical camera properties like aperture and focus distance, and animate focus pulls for professional-looking compositions.

Step 1: Enable 3D on Your Layers

Depth of field only affects 3D layers.

  1. Select the layers in your timeline that you want to exist in 3D space.
  2. Click the 3D Layer switch (the cube icon) for each layer.
  3. Position your layers at different Z-depths (Z-axis coordinates) so there is spatial separation between the foreground, midground, and background.

Step 2: Create and Configure a Camera

To use depth of field, your composition requires a dedicated camera layer.

  1. Go to Layer > New > Camera (or press Ctrl + Alt + Shift + C on Windows / Cmd + Opt + Shift + C on Mac).
  2. Choose either a One-Node Camera or a Two-Node Camera depending on your animation workflow.
  3. Check the box labeled Enable Depth of Field.
  4. Select a preset (such as 35mm or 50mm) and click OK.

Step 3: Access Camera Options

If depth of field was not enabled during setup, or if you need to adjust its intensity:

  1. Expand the Camera layer in the timeline.
  2. Twirl open Camera Options.
  3. Ensure Depth of Field is set to On.

Step 4: Adjust the Essential Depth of Field Settings

Controlling depth of field relies primarily on three parameters:

  • Focus Distance: This determines the exact distance from the camera lens to the point in 3D space that remains completely sharp.
  • Aperture: This controls the depth of the sharp area. Higher aperture values create a shallower depth of field (more pronounced background and foreground blur), while lower values keep more of the scene in focus.
  • Blur Level: This scales the intensity of the blur generated by the aperture. Leaving this at 100% provides physically accurate results based on the lens, but increasing it exaggerates the blur effect.

Step 5: Accurately Set the Focal Plane

Setting focus visually is easiest using multiple views:

  1. Change your composition view from 1 View to 2 Views - Horizontal using the view layout dropdown below the preview pane.
  2. Set one view to Active Camera and the other to Top.
  3. In the Top view, locate the camera wireframe. The line crossing the camera’s line of sight represents the Focus Distance.
  4. Scrub the Focus Distance value until that crosshair directly intersects the target layer.

Alternatively, you can automatically focus on a specific layer:

  1. Select the Camera layer and the target layer.
  2. Go to Layer > Camera > Link Focus Distance to Layer to attach the focal plane directly to that object via an expression.

Step 6: Create a Rack Focus Animation

To shift focus between two objects over time:

  1. Move the playhead to the starting frame.
  2. Set a keyframe on the camera's Focus Distance property focused on your first subject.
  3. Move the playhead forward in the timeline.
  4. Adjust the Focus Distance so the focal plane aligns with your second subject.
  5. Apply Easy Ease (F9) to the keyframes to ensure a smooth, natural transition between focal points.