docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MetaOpenXRCameraSubsystem

    The Meta-OpenXR implementation of the XRCameraSubsystem. Do not create this directly. Use the SubsystemManager instead.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRCameraSubsystem, XRCameraSubsystemDescriptor, XRCameraSubsystem.Provider>
    XRCameraSubsystem
    MetaOpenXRCameraSubsystem
    Implements
    ISubsystem
    Inherited Members
    XRCameraSubsystem.DoesCurrentCameraSupportTorch()
    XRCameraSubsystem.TryGetRenderingParameters(out XRCameraBackgroundRenderingParams)
    XRCameraSubsystem.GetTextureDescriptors(Allocator)
    XRCameraSubsystem.OnBeforeBackgroundRender(int)
    XRCameraSubsystem.TryGetIntrinsics(out XRCameraIntrinsics)
    XRCameraSubsystem.GetConfigurations(Allocator)
    XRCameraSubsystem.TryGetLatestFrame(XRCameraParams, out XRCameraFrame)
    XRCameraSubsystem.GetMaterialKeywords(out List<string>, out List<string>)
    XRCameraSubsystem.GetShaderKeywords()
    XRCameraSubsystem.GetShaderKeywords2()
    XRCameraSubsystem.TryAcquireLatestCpuImage(out XRCpuImage)
    XRCameraSubsystem.Register(XRCameraSubsystemCinfo)
    XRCameraSubsystem.currentCamera
    XRCameraSubsystem.requestedCamera
    XRCameraSubsystem.currentCameraBackgroundRenderingMode
    XRCameraSubsystem.requestedCameraBackgroundRenderingMode
    XRCameraSubsystem.supportedCameraBackgroundRenderingMode
    XRCameraSubsystem.autoFocusEnabled
    XRCameraSubsystem.autoFocusRequested
    XRCameraSubsystem.imageStabilizationEnabled
    XRCameraSubsystem.imageStabilizationRequested
    XRCameraSubsystem.requestedCameraTorchMode
    XRCameraSubsystem.currentCameraTorchMode
    XRCameraSubsystem.currentLightEstimation
    XRCameraSubsystem.requestedLightEstimation
    XRCameraSubsystem.cameraMaterial
    XRCameraSubsystem.permissionGranted
    XRCameraSubsystem.invertCulling
    XRCameraSubsystem.currentConfiguration
    SubsystemWithProvider<XRCameraSubsystem, XRCameraSubsystemDescriptor, XRCameraSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider.Start()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.Features.Meta
    Assembly: Unity.XR.MetaOpenXR.dll
    Syntax
    [Preserve]
    public sealed class MetaOpenXRCameraSubsystem : XRCameraSubsystem, ISubsystem

    Properties

    cpuImageApi

    The CPU image API used to construct XRCpuImage from XRCpuImage.Cinfo returned by TryAcquireLatestCpuImageForPosition(CameraPosition, out Cinfo) or TryAcquireLatestStereoCpuImagePair(out XRCpuImagePair).

    Declaration
    public XRCpuImage.Api cpuImageApi { get; }
    Property Value
    Type Description
    XRCpuImage.Api

    Methods

    GetAvailableCameras()

    Gets the available cameras on this device.

    Declaration
    public MetaOpenXRCameraSubsystem.AvailableCameras GetAvailableCameras()
    Returns
    Type Description
    MetaOpenXRCameraSubsystem.AvailableCameras

    A bitfield of available cameras. The bits that are set indicate which cameras are available.

    ReleaseGpuImage(XRTextureDescriptor)

    Releases a previously successfully acquired native texture descriptor.

    Declaration
    public void ReleaseGpuImage(XRTextureDescriptor descriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor descriptor

    The texture descriptor that was returned by TryAcquireLatestGpuImage(out XRTextureDescriptor).

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the provided descriptor does not match the currently held GPU image.

    ReleaseGpuImageForPosition(CameraPosition, XRTextureDescriptor)

    Releases a previously successfully acquired GPU image for the specified camera.

    Declaration
    public void ReleaseGpuImageForPosition(MetaOpenXRCameraSubsystem.CameraPosition position, XRTextureDescriptor descriptor)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.CameraPosition position

    The camera position that the image was acquired from.

    XRTextureDescriptor descriptor

    The texture descriptor that was returned by TryAcquireLatestGpuImageForPosition(CameraPosition, out XRTextureDescriptor).

    Exceptions
    Type Condition
    ArgumentException

    Thrown when position doesn't match descriptor camera source.

    ReleaseStereoGpuImagePair(XRTextureDescriptorPair)

    Releases a previously acquired stereo GPU image pair.

    Declaration
    public void ReleaseStereoGpuImagePair(MetaOpenXRCameraSubsystem.XRTextureDescriptorPair descriptorPair)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.XRTextureDescriptorPair descriptorPair

    The stereo pair (left and right camera texture descriptors) to release.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when attempted release of pairs were not acquired together.

    SetMaxStereoSyncAttempts(int)

    Sets the maximum number of sync attempts when matching stereo pair timestamps. Use a higher value (e.g. 5–10) if the cameras are not stereo synced and stereo acquire often fails. Clamped to 1–10. Default is 3. Can be called before or after the subsystem starts.

    Declaration
    public static void SetMaxStereoSyncAttempts(int maxAttempts)
    Parameters
    Type Name Description
    int maxAttempts

    Maximum number of sync attempts (1–10)

    SupportsStereoImageCapture()

    Queries whether synchronized stereo image capture (both cameras from the same frame) is supported on this device.

    Declaration
    public bool SupportsStereoImageCapture()
    Returns
    Type Description
    bool

    true if stereo capture is supported. Otherwise false.

    TryAcquireLatestCpuImageForPosition(CameraPosition, out Cinfo)

    Acquires the latest CPU image for the requested camera.

    Use TryAcquireLatestCpuImage(out XRCpuImage) for the default (mono) image or this method for a specific camera.

    Declaration
    public bool TryAcquireLatestCpuImageForPosition(MetaOpenXRCameraSubsystem.CameraPosition position, out XRCpuImage.Cinfo cameraImageCinfo)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.CameraPosition position

    The camera position to acquire the image from (LeftEye or RightEye).

    XRCpuImage.Cinfo cameraImageCinfo

    The metadata required to construct a XRCpuImage.

    Returns
    Type Description
    bool

    true if the camera image is acquired. Otherwise, false.

    TryAcquireLatestGpuImage(out XRTextureDescriptor)

    Attempts to acquire the texture descriptor for a camera GPU image as a native texture.

    Declaration
    public bool TryAcquireLatestGpuImage(out XRTextureDescriptor descriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor descriptor

    The descriptor to fill in with the texture information if successful.

    Returns
    Type Description
    bool

    true if the method successfully acquires the native texture descriptor. Otherwise, false.

    TryAcquireLatestGpuImageForPosition(CameraPosition, out XRTextureDescriptor)

    Attempts to acquire the texture descriptor for GPU image for the specified camera.

    Declaration
    public bool TryAcquireLatestGpuImageForPosition(MetaOpenXRCameraSubsystem.CameraPosition position, out XRTextureDescriptor descriptor)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.CameraPosition position

    The camera position to acquire the image from.

    XRTextureDescriptor descriptor

    The descriptor to fill in with the texture information if successful.

    Returns
    Type Description
    bool

    true if the method successfully acquires the native texture descriptor. Otherwise, false.

    TryAcquireLatestStereoCpuImagePair(out XRCpuImagePair)

    Attempts to acquire a synchronized stereo pair of CPU images (both cameras from the same capture request). Returns false if stereo is not available or the latest left/right frames are not synchronized. The pair can be turned into XRCpuImage instances via cpuImageApi.

    Declaration
    public bool TryAcquireLatestStereoCpuImagePair(out MetaOpenXRCameraSubsystem.XRCpuImagePair pairImageCinfo)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.XRCpuImagePair pairImageCinfo

    The left and right image metadata if successful.

    Returns
    Type Description
    bool

    true if both images were acquired and are synchronized. Otherwise false.

    TryAcquireLatestStereoGpuImagePair(out XRTextureDescriptorPair)

    Attempts to acquire a synchronized stereo pair of GPU images (both cameras from the same capture request). Only available when using logical camera approach. Returns false if images are not synchronized.

    Declaration
    public bool TryAcquireLatestStereoGpuImagePair(out MetaOpenXRCameraSubsystem.XRTextureDescriptorPair descriptorPair)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.XRTextureDescriptorPair descriptorPair

    The texture descriptors for the left and right camera if successful.

    Returns
    Type Description
    bool

    true if both images were acquired and are synchronized (same capture request). Otherwise, false.

    TryGetFrameForPosition(CameraPosition, XRCameraParams, out XRCameraFrame)

    Gets the camera frame for the requested camera.

    Use TryGetLatestFrame(XRCameraParams, out XRCameraFrame) for the default (mono) frame or this method for a specific camera.

    Declaration
    public bool TryGetFrameForPosition(MetaOpenXRCameraSubsystem.CameraPosition position, XRCameraParams cameraParams, out XRCameraFrame cameraFrame)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.CameraPosition position

    Which camera to get the frame for (LeftEye or RightEye).

    XRCameraParams cameraParams

    Parameters used for frame conversion (e.g. screen dimensions).

    XRCameraFrame cameraFrame

    The camera frame data if successful.

    Returns
    Type Description
    bool

    true if the frame was successfully retrieved. Otherwise false.

    TryGetIntrinsicsForPosition(CameraPosition, out XRCameraIntrinsics)

    Gets the camera intrinsics for the requested camera.

    Use TryGetIntrinsics(out XRCameraIntrinsics) for the default (mono) intrinsics or this method for a specific camera.

    Declaration
    public bool TryGetIntrinsicsForPosition(MetaOpenXRCameraSubsystem.CameraPosition position, out XRCameraIntrinsics cameraIntrinsics)
    Parameters
    Type Name Description
    MetaOpenXRCameraSubsystem.CameraPosition position

    Which camera to get the intrinsics for (LeftEye or RightEye).

    XRCameraIntrinsics cameraIntrinsics

    The camera intrinsics if successful.

    Returns
    Type Description
    bool

    true if the intrinsics were successfully retrieved. Otherwise false.

    Implements

    ISubsystem
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)