Mobile Depth of Field Method

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

Gaussian

This depth of field method has been deprecated with Unreal Engine 4.21 for the Deferred and Desktop Forward Renderers.

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 devices. 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 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.

Guassian_DOFSettingsInVisualization636671458785041968

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.

Click image for full size.

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

GuassianDOF_1-1.png

Gaussian 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

Gaussian DOF Settings

The following settings are available with the Cine Camera, Camera, and Post Process Volumes, located under the Lens tab in the Depth of Field section.

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 diameter in percent of the screen width.

It adds performance costs if the mask is used.