Photorealistic rendering and depth of field (DOF)

One of my current favorite methods of enhancing the photo-realism of a rendering is by using depth of field (DOF) blur.  With my interest in photography, I like to find the ways I can blur the line (so to speak!) between a computer generated image and a photograph.

When a computer rendering is generated, it produces an infinite depth of field – everything is perfectly in focus, near and far. On the other hand with a camera, the lens’ aperture mimics human vision in permitting the camera to only have accurate focus within a specific range of distance, also known as the depth of field. The result is blurriness further away from the object that is in focus.

Many of the rendering programs have methods to add DOF to an image, with trade-offs resulting from different approaches. The method I am using for my example is to generate a map of the 3D depth in the image as a layer. This has two main advantages, and one big disadvantage:

  1. Good: speed – it’s faster to render, as the rendering software doesn’t have to also calculate the DOF.
  2. Good:  I can control the blurriness in Photoshop without having to render the image again.
  3. Bad: reflections are not blurred, nor are objects through glass.

Here is the base image I am using for my example and the “zdepth” layer shown next to it:

And without further ado, here are two versions of DOF blur – one focusing on the fireplace, and the other focusing on near objects.

As you can see, DOF can be very useful to direct the eye towards a focal point, or emphasize certain elements of an image. The first image blurs the foreground to highlight the stone fireplace. The second downplays the chimney in favor of a more photographic style where the detailed foreground is given more weight. This second approach helps give the room a sense of depth as the side walls and fireplace recede into the distance.

Used judiciously, (and once the other elements of the rendering have been accounted for – lighting, materials, contrast, etc.), depth of field can be one more tool to bring a rendering to life.