docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SpatialImageTrackingSubsystem

    The OpenXR Spatial Entities implementation of the UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem. Don't create this directly. Use the SubsystemManager instead.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    XRSubsystem<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>
    XRImageTrackingSubsystem
    SpatialImageTrackingSubsystem
    Implements
    ISubsystem
    Inherited Members
    XRImageTrackingSubsystem.OnStart()
    XRImageTrackingSubsystem.OnStop()
    XRImageTrackingSubsystem.imageLibrary
    XRImageTrackingSubsystem.CreateRuntimeLibrary(XRReferenceImageLibrary)
    XRImageTrackingSubsystem.TryCreateRuntimeLibraryAsync(XRReferenceImageLibrary, CancellationToken)
    XRImageTrackingSubsystem.GetChanges(Allocator)
    XRImageTrackingSubsystem.requestedMaxNumberOfMovingImages
    XRImageTrackingSubsystem.currentMaxNumberOfMovingImages
    TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.GetChanges(Allocator)
    XRSubsystem<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.GetPermissionState()
    XRSubsystem<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.TryStartAsync(CancellationToken, XRSubsystemStartOptions)
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnCreate()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnStart()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnStop()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.OnDestroy()
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.provider
    SubsystemWithProvider.Start()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.OnDestroy()
    SubsystemWithProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.Features.SpatialEntities
    Assembly: Unity.XR.SpatialEntities.dll
    Syntax
    [Preserve]
    public class SpatialImageTrackingSubsystem : XRImageTrackingSubsystem, ISubsystem

    Methods

    GetPermissionState()

    Get the state of any required permissions for this subsystem to run on the current device.

    Declaration
    public override XRPermissionState GetPermissionState()
    Returns
    Type Description
    XRPermissionState

    The permission state.

    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.Provider>.GetPermissionState()

    GetSupportedTextureFormats()

    Returns the texture formats the OpenXR runtime supports for reference images, as reported by xrEnumerateSpatialReferenceImageFormatsEXT. Formats the runtime reports that have no equivalent Unity TextureFormat (such as YUV 4:2:0) are omitted.

    Declaration
    public List<TextureFormat> GetSupportedTextureFormats()
    Returns
    Type Description
    List<TextureFormat>

    The supported texture formats, or an empty list if the runtime hasn't been initialized or the enumeration failed.

    TryDestroyImageDatabase(SpatialImageDatabase)

    Destroys the underlying native image-tracking database. The managed SpatialImageDatabase wrapper is invalidated and should no longer be used if this call returns success.

    Declaration
    public XRResultStatus TryDestroyImageDatabase(SpatialImageDatabase imageDatabase)
    Parameters
    Type Name Description
    SpatialImageDatabase imageDatabase

    The database to destroy.

    Returns
    Type Description
    XRResultStatus

    The status of the destroy operation.

    Remarks

    If imageDatabase is the database currently assigned to UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.imageLibrary, image tracking stops.

    TryStartAsync(CancellationToken, XRSubsystemStartOptions)

    Requests the scene permission when needed. The dedicated image context itself is created later when an image library is assigned.

    Declaration
    public override Awaitable<XRResultStatus> TryStartAsync(CancellationToken token, XRSubsystemStartOptions options = XRSubsystemStartOptions.None)
    Parameters
    Type Name Description
    CancellationToken token

    A cancellation token, which you can use to cancel the operation in progress.

    XRSubsystemStartOptions options

    The options to start the subsystem with.

    Returns
    Type Description
    Awaitable<XRResultStatus>

    The status of the operation.

    Overrides
    XRSubsystem<XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>.TryStartAsync(CancellationToken, XRSubsystemStartOptions)
    Exceptions
    Type Condition
    OperationCanceledException

    Thrown if token is canceled or the subsystem stops while this method is waiting for an in-progress call to TryCreateRuntimeLibraryAsync(XRReferenceImageLibrary, CancellationToken) to complete.

    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)