Example LeiaLogo scene with depth of field effect applied
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 convergence plane and bring focus to objects that are in front or popping out of the display.
Requirements: Unity 2019.4 or newer
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
1.1 First, install Post Processing V2 from the unity package manager.
1.2 Then, see instructions on how to make Post Processing V2 work with the Leia SDK here:
Step 2 - Add a Post Process layer component to your Main Camera game object
2.1 Create a new layer in Unity called "PostProcessing"
2.2 Set the Post Process Layer component's volume blending layer to use the PostProcessing layer
2.3 Set the LeiaCamera game object layer to PostProcessing
Step 3 - Post Process Volume Component
3.1 Add a post process volume component to your Main Camera game object
3.2 For the profile slot, click the "New" button to create a new profile
3.3 Click "Add effect..." and select "Unity > Depth of Field"
3.4 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:
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.