Set up your scene
To set up your scene for Android XR, first follow the standard AR Foundation Scene setup process. If your scene will use the Android XR device's passthrough camera, refer to the following sections.
Ensure that the Tracked Pose Driver component on your camera has "centerEyePosition [XR HMD]" included in the position and rotation input actions.
Configure camera background for passthrough
Android XR passthrough requires that your Camera's Background Color (Universal Render Pipeline) or Clear Flags (Built-In Render Pipeline) are set to Solid Color, with the Background color alpha channel value set to zero.
Note
The passthrough video is layered behind the image rendered by the scene camera. If you configure the camera's background color (or clear flags) to use a skybox or an opaque solid color, then the passthrough video is covered up by the camera background.
If you have completed the AR Foundation scene setup steps, follow these instructions to configure your scene to render with a transparent camera background:
- Locate the GameObject named XR Origin in your GameObject hierarchy. (Refer to Scene setup in the AR Foundation manual for instructions on how to set up the scene if it does not already contain an XR Origin.)
- Expand the hierarchy to reveal the Camera Offset and Main Camera GameObjects.
- Inspect the Main Camera GameObject.
- Select from the following options. The options differ based on the render pipeline you're using:
- URP: In the Environment section, set the Background Type to Solid Color.
- Built-In Render Pipeline: Set Clear Flags to Solid Color.
- Select the Background color to open the color picker.
- Set the color's A value to
0
.
Your scene is now configured to support Android XR passthrough.
Additional resources
- Graphics settings
- Scene setup (AR Foundation)