LogoLogo
Sign in to Leia Developer Portal
  • LeiaSR™ Documentation
  • LeiaSR SDK
    • LeiaSR™ Native SDK Guide
  • Unity Plugin
    • LeiaSR™ Unity Plugin Guide
      • Getting Started
      • Project Setup
      • Scene Setup
      • LeiaDisplay Component
        • Selecting Objects
        • Worldspace UI Canvas
      • Quick API
      • Extensions
        • Model Viewer Sample Scene
        • Android Live Preview: Leia Remote 2
        • Auto Focus
          • LeiaRaycastFocus
          • LeiaTargetFocus
          • LeiaDepthFocus
      • Content Design
        • Optimizing Object Placement
        • UI and Depth Violations
        • Depth of Field
        • Backgrounds
      • Render Pipeline Support
  • Unreal Plugin
    • Unreal SDK Guide
      • Getting Started
      • Manual Download And Import
      • Scene Setup
      • Quick API
      • Extensions
        • Android Live Preview: Leia Remote 2
      • Required Project Settings
      • Required Build Settings: Android
      • Content Design
  • NEURD SDK
    • NeurD SDK Guide
Powered by GitBook
On this page
  1. Unity Plugin
  2. LeiaSR™ Unity Plugin Guide
  3. Content Design

Depth of Field

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

PreviousUI and Depth ViolationsNextBackgrounds

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.

Example LeiaLogo scene with depth of field effect applied