Depth of Field

Smooth over the too close and too far object with depth of field.

Depth of Field reduces high color contrast edges by applying a blur effect to pixels which blends them with the colors of surrounding pixels. Depth of field is a great way to improve the depth of content on Leia Displays, as it can reduce high contrast edges which are further behind the Leia Display plane and bring focus to objects that are in front or popping out of the display.

How to Integrate Depth of Field into a Unity Project which uses the Leia SDK

Step 1 - Install Post Processing V2 and get it working with the Leia SDK

The Leia Unity SDK supports Post Processing Stack v3.0.2+

Step 2 - Add a Post Process layer component to your Main Camera game object

Create a new layer in Unity called "PostProcessing"

Set the Post Process Layer component's volume blending layer to use the PostProcessing layer

Set the Camera game object layer to PostProcessing

Step 3 - Post Process Volume Component

Add a post process volume component to your Main Camera game object

For the profile slot, click the "New" button to create a new profile

Click "Add effect..." and select "Unity > Depth of Field"

You can now adjust the depth of field effects focus distance, aperture, focal length, and max blur size from the Post-process Volume component to values that suit the content in your scene:

Tip:

Make sure your camera's clipping plane distance is not too large. If your camera's clipping plane distance is too large, it will make the effect more difficult to precisely control and adjust. Setting smaller clipping plane distances will allow you to more finely tune the effect.

Last updated

Copyright © 2023 Leia Inc. All Rights Reserved