Depth of field

What is "depth of field"?

Depth of field ("DOF" for short) is a graphics feature introduced to the experimental Second Life "Mesh Import Project" Viewer in late November 2010, then supported in the main SL Viewer in June 2011. This page aims to explain what the effect does, how it might change in the future, and what debug settings control it and what they mean.

DOF simulates the real-world optical effect with the same name, a photographic effect caused by a lens focusing on a particular subject. There are two planes to consider — a near focal plane and a far focal plane. When an object is between the far focal plane and near focal plane, it is considered to be in-focus. The human eye is subject to depth of field, but because the field of view of Second Life is more similar to a camera, the inworld depth of field effect is modeled after a 35mm camera with a focal length of 50mm.

DOF can be used to creatively draw attention to a scene's focal area, and is already used in many popular games. DOF's creative possibilities are appealing to artists like photographers and machinimatographers.

How can I see the depth of field effect?

DOF and the other graphical effects that must be enabled to see it are collectively taxing, and are best enjoyed with a graphics card and computer system that significantly exceeds the System Recommendations.

In the main SL Viewer in Advanced mode:

  1. Select Me menu > Preferences.
  2. In the Preferences window, click Graphics tab.
  3. Set the Quality and speed slider to Ultra.

Or, if you want to be more selective:

  1. While you're still in the Graphics tab, click Advanced button.
  2. Check Lighting and Shadows, which is a prerequisite.
  3. You can now check Depth of Field.
⚠️ Warning: DOF is still a new-ish feature, and like other advanced graphics features, are subject to change. Furthermore, their rendered appearance may differ and hopefully improve from version to version.

This video tutorial has older steps that are no longer relevant, but the principles are still the same:

<videoflash type="youtube">OOHFNywu22I|640|385</videoflash>

How do I customize my DOF settings?

  1. Enable Advanced menu.
  2. Choose Advanced > Show Debug Settings.
  3. Enter a DOF setting (it autocompletes) and change its value.

The settings are:

For example:

  1. Set CameraFocalLength to 200.000.
  2. Alt-click on your avatar to center that point and give it focus, and observe distant objects.

How do I get tilt-shift effects?

Tilt-shift photography is popularly used for simulating miniature scenes. Try these settings:

Want a more drastic effect? Raise CameraFieldOfView to something like 120.000.

Defocused area too blurry? Raise CameraFNumber.

After June 2011, Torley habitually learned to keep the Debug Settings window open while adjusting CameraFNumber as needed, depending on distance to subject. Some 3rd-party viewers provide more direct access to these controls.

And remember to Alt-click to focus. It helps to use the keyboard camera shortcuts if you want the focused area to be non-centered. (Otherwise, crop the image in post-processing.) Your end result can be awesome like this (whee! Look at the little doll people):

Torley's preferred settings (as of May 2012)

These are optimized for big bokeh, favoring strength over subtlety. Requires a fairly powerful graphics card, or performance will suffer:

Preparation:

  1. Tap Ctrl-0 4-6 times to zoom in and narrow the field of view, creating a more intimate relationship with the tightly-focused subject matter.
  2. Select Advanced menu > Debug Settings.
  3. Set RenderVolumeLODFactor = 8 or even 16, although that may be overkill. This makes it so curves don't look jaggy when zoomed up close.
  4. As-needed, set RenderAvatarLODFactor = 8 or another high value too.

And the specific DoF settings:

Example:

Torley's even newer settings

See also

Example videos from Residents

<videoflash type="youtube">Y-AK3t_sqe4|640|385</videoflash>
<videoflash type="youtube">41zDmAZxlZU|640|385</videoflash>
<videoflash type="youtube">hsFLVBG3ykE|640|385</videoflash>
<videoflash type="youtube">PKz81Q7mRGw|640|385</videoflash>
<videoflash type="youtube">C139ZBcKMQc|640|385</videoflash>