Language:
Page Info
Engine Version:

Mobile Depth of Field

Choose your OS:

The following depth of field method provides an optimized and low-cost depth of field effect for mobile platforms using the Forward rendering path.

Gaussian

The Deferred renderer will no longer support Gaussian Depth of Field method and will only be supported for the Mobile rendering path.

The Gaussian depth of field (DOF) method blurs the scene using a standard Gaussian blur (or smoothing) function. Gaussian DOF blur foreground and background uses a fixed size Gaussian blur kernel, which is very fast on lower-end hardware, such as mobile. This enables performance to be maintained with lower overhead costs where performance is critical.

No Depth of Field

Gaussian Depth of Field

Visualizing Depth of Field

These layers, including transition regions, can be visualized using the Depth of Field layers show flag in the Level Viewport under Show > Visualize.

Final Scene

Depth of Field Visualization

Visualizing the Depth of Field Layers also includes useful information relevant to the DOF method selected by including the properties and their currently set values.

image_4.png

Focal Distance

The Focal Distance represents the focal region and the angle of view that will be captured. A longer focal length has a shallow depth of field causing objects to be more blurred outside of the focal region while shorter focal lengths have a wider depth of field with sharper focus and fewer objects out of focus. The f-stop number can stay the same and changing the lens size adjusts how shallow or wide the depth of field effect is.

Once you’ve set the Focal Distance and the Focal Region, you can use the Near Transition and Far Transition to adjust the are distance between the focal region and the fully blurred scene. In addition, you can even adjust the Near Blur Size and the Far Blur Size to further tweak the look of Guassian DOF.

image_6.png

Guassian DOF with adjusted values for Near/Far Transition and Blur Size to produce a nice depth of field effect.

In this example, the following values have been set to produce a soft depth of field effect for near and far regions.

  • Focal Distance: 215

  • Focal Region: 2500

  • Near Transition: 500

  • Far Transition: 400

  • Near Blur Size: 2.0

  • Far Blur Size: 2.5

Available Settings

Property

Description

High Quality Gaussian DOF on Mobile

Enables HQ Gaussian on high-end mobile platforms.

Focal Distance

The distance in which the depth of field effect should be sharp. This value is measured in Unreal Units (cm).

Near Transition Region

The distance in Unreal Units from the focal region on the side nearer to the camera over which the scene transitions from focused to blurred when using Bokeh or Gaussian DOF.

Far Transition Region

The distance in Unreal units from the focal region on the side farthest from the camera over which the scene transitions from focused to blurred when using Bokeh or Gaussian DOF.

Focal Region

An artificial region where all content is in focus, starting after the Focal Distance (measured in Unreal Units (cm)).

Near Blur Size

The maximum size (in percent of the view width) of the near blur for Gaussian-based DOF. Note that performance cost scales with size.

Far Blur Size

The maximum size (in percent of the view width) of the far blur for Gaussian-based DOF. Note that performance cost scales with size.

Sky Distance

Artificial distance to allow the skybox to be in focus (for example, 200000 units), where values less than 0 will disable the feature. Note that this feature can cost performance.

Vignette Size

Artificial circular mask to (near) blur content outside the radius in diameter in percent of screen width. This costs performance if the mask is used.