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. Extensions
  4. Auto Focus

LeiaDepthFocus

PreviousLeiaTargetFocusNextContent Design

The LeiaDepthFocus component samples the render texture of a depth camera to determine the best focal distance and depth factor for the LeiaDisplay.

Pros:

  • Fast

  • Accurate

  • Easy to use

  • Doesn't require setting up colliders in your scene for use with autofocus (unlike ).

Cons:

  • Won't work in scenes where scene objects use shaders that don't write to the depth buffer.

  • Won't work on platforms that don't support compute shaders.

Tips to get this working:

  • Clamp the near plane and far plane of your camera to as tightly encapsulate the content of the scene as possible, as LeiaDepthFocus reads it's depth as a percentage from the near plane to the far plane.

  • Having too large of a far plane can cause the depth to get squashed, flattening everything in the scene.

LeiaRaycastFocus