Camera components
AR Foundation uses two primary components to control device camera functionality in your AR scene: ARCameraManager and ARCameraBackground. Your scene should contain at most one of each of these components enabled at a time. After initial scene setup you can find AR Camera Manager and AR Camera Background components in the XR Origin GameObject hierarchy at XR Origin > Camera Offset > Main Camera.
AR Camera Manager component
The ARCameraManager component is a manager that enables or disables the device camera when the component is enabled or disabled, respectively, and gives you a scripting interface for camera-related features.
AR Camera Manager component
Property | Description |
---|---|
Auto Focus | Enables or disables a request to use the camera's automatic focus mode. When disabled, fixed focus mode is used. Availability of Auto Focus depends on camera hardware. |
Image Stabilization | Helps stabilize shaky video from the camera. You can check the XRCameraSubsystemDescriptor.supportsImageStabilization to determine whether your provider supports Image Stabilization. |
Light Estimation | Estimates lighting properties of the environment. There are five options:
|
Facing Direction | Controls which camera is used. This value can be either World or User. On handheld mobile devices like phones and tablets, World refers to the rear camera and User refers to the front-facing ("selfie") camera. |
Render Mode | Sets the ARCameraManager 's requestedBackgroundRenderingMode, which specifies the stage in Unity's render pipeline that the AR camera background is rendered. There are three options:
|
Note
After Opaques has slightly different rendering behavior beyond its render order. After Opaques also causes ARCameraBackground
to render a fullscreen quad at the Camera's farClipPlane to ensure that depth testing properly culls fragments that are behind opaque geometry.
AR Camera Background component
The ARCameraBackground component renders video from the device camera as the background of the scene. Enable this component to render the AR background, and disable it to disable background rendering.
AR Camera Background component
Property | Description |
---|---|
Use Custom Material | If you set Use Custom Material to true, ARCameraBackground uses the Custom Material you specify to render the background. |
Custom Material | Only visible if Use Custom Material is true. Set this property to use your own shader to render the background. AR Foundation uses the Material from the active provider plug-in by default, but you can override the default with your own Material. |
Apple and ARKit are trademarks of Apple Inc., registered in the U.S. and other countries and regions.