Table of Contents

Configuring camera

Through the following content, you will learn how to configure the camera for AR scenes in Unity to achieve the best AR experience.

Before you begin

  • Understand the role of the camera in AR scenes and how the session controls camera properties to ensure a correct AR experience through Camera.

Camera configuration for mobile and PC devices

alt text alt text

When using AR on mobile and PC devices, it is recommended to configure as follows:

  • Clear Flags: Must be set to Solid Color to ensure the camera image renders correctly. If left as the default Skybox, the camera image will not display.
  • Background: Optional. Considering the user experience, it is recommended to set the background color to black for a black transition before the camera device starts or during switching.
  • Clipping Planes: In addition to general rendering and performance needs, consider the physical size and distance of recognized/interactive objects or real-world scenes. For example, set Near to 0.1 (meters) to avoid display issues when the camera is close to objects, and set Far to 1000 (meters) to avoid distant objects not rendering.
Note

When using the AR Foundation camera or other Unity XR Origin cameras, Unity typically presets their clipping planes to (0.1, 20). This may cause objects beyond 20 meters in the real world to not display. Please modify this according to specific needs before use.

Camera configuration for headsets

When using headsets, the camera is usually configured and controlled by the device SDK. Therefore, it is recommended to retain the device SDK’s default configuration or configure according to the device SDK's requirements. Additionally, you may modify Clipping Planes as needed.