Depth of Field

Depth of Field is currently only available for the Pragma renderer.


To add a depth of field effect to your camera, expand the camera actor in the actor editor, right click "Components" and add the optical_camera component:


Now select the "optical_component" from the component list, and you will see a number of DoF options appearing on the right:


Make sure to switch from the work camera to the scene camera if you want to make changes to the DoF settings, otherwise you will not see what changes. Additionally, whenever you make changes to the DoF settings, you should enable the "showDebugFocus" option. This will enable a helper overlay, which will make it easier to define the DoF area:


The blue area represents the focal range and the yellow line the focus point. These can be adjusted with the "focalDistance", "focalLength" and "fstop" properties. Make sure to disable this option when you're done.

Here's a list of some of the available properties:

  • focalDistance: The distance from the camera to the center of the focal area in game units.
  • focalLength: The length of the focal area in game units.
  • fstop: Defines the amount of blurring.
  • ringSamples: Quality of the blur effect.
  • circleOfConfusion: Circle of confusion in mm.
  • maxBlur: Intensity of the blur. Higher values will require a higher number of ringSamples as well.
  • ditherAmount: Adds random noise to the effect.
  • enableVignette: Adds a camera vignette effect near the borders.
  • vignetteInnerBorder: Controls the start border distance for the vignette effect.
  • vignetteOuterrBorder: Controls the end border distance for the vignette effect.
  • usePentagonBokehShape: Changes the bokeh to use a pentagon shape.
  • pentagonShapeFeather: Pentagon shape feather.
  • showDebugFocus: Toggles the helper overlay.