Table of Contents

Configure camera

Through the following content, you will learn how to configure the camera in Unity's AR scene to achieve the best AR experience.

Before you begin

  • Learn about the role of the camera in AR scenes and how the session controls the camera's properties to ensure a proper 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 the camera as follows:

  • Clear Flags: Must be set to Solid Color to ensure the camera image renders correctly. If the default Skybox is retained, the camera image will not display.
  • Background: Optional. For a better user experience, it is recommended to set the background color to black to provide a smooth transition when the camera device is turned on or switching.
  • Clipping Planes: In addition to general rendering and performance requirements, consider the physical size and distance of the objects or real-world scenes being recognized and interacted with. For example, set Near to 0.1 (meters) to avoid objects not being displayed when the camera is too close, and set Far to 1000 (meters) to avoid distant objects not being displayed.
Note

When using AR Foundation or other Unity XR Origin cameras, Unity typically presets their clipping planes to (0.1, 20), which may cause objects farther than 20 meters in the real world to not display. 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 default configuration of the device SDK or configure it according to the device SDK's requirements. Additionally, you can modify the Clipping Planes as needed.