docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ARKitCameraSubsystem

    The camera subsystem implementation for ARKit.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRCameraSubsystem, XRCameraSubsystemDescriptor, XRCameraSubsystem.Provider>
    XRCameraSubsystem
    ARKitCameraSubsystem
    Implements
    ISubsystem
    Inherited Members
    XRCameraSubsystem.currentCamera
    XRCameraSubsystem.requestedCamera
    XRCameraSubsystem.currentCameraBackgroundRenderingMode
    XRCameraSubsystem.requestedCameraBackgroundRenderingMode
    XRCameraSubsystem.supportedCameraBackgroundRenderingMode
    XRCameraSubsystem.autoFocusEnabled
    XRCameraSubsystem.autoFocusRequested
    XRCameraSubsystem.imageStabilizationEnabled
    XRCameraSubsystem.imageStabilizationRequested
    XRCameraSubsystem.currentLightEstimation
    XRCameraSubsystem.requestedLightEstimation
    XRCameraSubsystem.cameraMaterial
    XRCameraSubsystem.TryGetRenderingParameters(out XRCameraBackgroundRenderingParams)
    XRCameraSubsystem.permissionGranted
    XRCameraSubsystem.invertCulling
    XRCameraSubsystem.currentConfiguration
    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.TryAcquireLatestCpuImage(out XRCpuImage)
    XRCameraSubsystem.Register(XRCameraSubsystemCinfo)
    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.ARKit
    Assembly: Unity.XR.ARKit.dll
    Syntax
    [Preserve]
    public sealed class ARKitCameraSubsystem : XRCameraSubsystem, ISubsystem

    Fields

    backgroundShaderNames

    The names for the background shaders based on the current render pipeline.

    Declaration
    public static readonly string[] backgroundShaderNames
    Field Value
    Type Description
    string[]

    The names for the background shaders based on the current render pipeline.

    Remarks

    There are two shaders in the Apple ARKit Provider Package. One is used for rendering before opaques and one is used for rendering after opaques.

    In order:

    1. Before Opaques Shader Name
    2. After Opaques Shader Name

    Properties

    advancedCameraConfigurationSupported

    Get whether advanced camera hardware configuration is supported. Advanced camera hardware configuration requires iOS 16 or newer and a device with an ultra-wide camera.

    Declaration
    public bool advancedCameraConfigurationSupported { get; }
    Property Value
    Type Description
    bool

    true if setting advance camera hardware configurations is supported. Otherwise, false.

    See Also
    TryGetLockedCamera(out ARKitLockedCamera)

    backgroundShaderName

    The name for the background shader.

    Declaration
    [Obsolete("'backgroundShaderName' is obsolete, use backgroundShaderNames instead. (2022/04/04)")]
    public static string backgroundShaderName { get; }
    Property Value
    Type Description
    string

    The name for the background shader.

    Methods

    TryAcquireHighResolutionCpuImage()

    Creates and returns a promise of a high resolution CPU image. You can yield return on the promise in a coroutine to await the asynchronous result.

    Requires iOS 16 or newer.

    Declaration
    public HighResolutionCpuImagePromise TryAcquireHighResolutionCpuImage()
    Returns
    Type Description
    HighResolutionCpuImagePromise

    The promise instance.

    Remarks

    See ARKit's captureHighResolutionFrameWithCompletion documentation for more information.

    On iOS 15 or below, promises will immediately resolve with an unsuccessful result.

    Only one instance of HighResolutionCpuImagePromise at a time can await a result. Promises created while another promise is in progress will immediately resolve with an unsuccessful result.

    Examples
    IEnumerator MyCoroutine()
    {
        var promise = TryAcquireHighResolutionCpuImage();
        yield return promise;
        if (promise.result.wasSuccessful)
            Debug.Log(promise.result.highResolutionCpuImage.ToString());
    }

    TryGetLockedCamera(out ARKitLockedCamera)

    Locks the primary camera associated with the current session configuration and returns an object that represents it. Use this object to configure advanced camera hardware properties. For more information, see ARKit's [AVCaptureDevice.lockForConfiguration] (https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387810-lockforconfiguration?language=objc).

    Declaration
    public bool TryGetLockedCamera(out ARKitLockedCamera lockedCamera)
    Parameters
    Type Name Description
    ARKitLockedCamera lockedCamera

    A disposable object that represents the locked configurable primary camera.

    Returns
    Type Description
    bool

    true if a configurable camera is available in the current session configuration and can be locked. Otherwise, false.

    Remarks

    Requires iOS 16 or newer and a device with an ultra-wide camera.

    See Also
    advancedCameraConfigurationSupported

    Implements

    ISubsystem
    In This Article
    Back to top
    Copyright © 2024 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)