docs.unity3d.com
    Show / Hide Table of Contents

    Class XROcclusionSubsystem

    Defines an interface for interacting with occlusion functionality.

    Inheritance
    Object
    Subsystem
    Subsystem<XROcclusionSubsystemDescriptor>
    XRSubsystem<XROcclusionSubsystemDescriptor>
    XROcclusionSubsystem
    Inherited Members
    XRSubsystem<XROcclusionSubsystemDescriptor>.running
    XRSubsystem<XROcclusionSubsystemDescriptor>.OnDestroy()
    XRSubsystem<XROcclusionSubsystemDescriptor>.Start()
    XRSubsystem<XROcclusionSubsystemDescriptor>.Stop()
    Subsystem<XROcclusionSubsystemDescriptor>.SubsystemDescriptor
    Subsystem.Destroy()
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class XROcclusionSubsystem : XRSubsystem<XROcclusionSubsystemDescriptor>, ISubsystem

    Constructors

    XROcclusionSubsystem()

    Construct the subsystem by creating the functionality provider.

    Declaration
    public XROcclusionSubsystem()

    Properties

    currentHumanDepthMode

    Get the human segmentation depth mode currently in use by the provider.

    Declaration
    public HumanSegmentationDepthMode currentHumanDepthMode { get; }
    Property Value
    Type Description
    HumanSegmentationDepthMode

    currentHumanStencilMode

    Get the current segmentation stencil mode in use by the subsystem.

    Declaration
    public HumanSegmentationStencilMode currentHumanStencilMode { get; }
    Property Value
    Type Description
    HumanSegmentationStencilMode

    requestedHumanDepthMode

    Specifies the human segmentation depth mode.

    Declaration
    public HumanSegmentationDepthMode requestedHumanDepthMode { get; set; }
    Property Value
    Type Description
    HumanSegmentationDepthMode

    The human segmentation depth mode.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when setting the human segmentation depth mode to enabled if the implementation does not support human segmentation.

    requestedHumanStencilMode

    Specifies the human segmentation stencil mode.

    Declaration
    public HumanSegmentationStencilMode requestedHumanStencilMode { get; set; }
    Property Value
    Type Description
    HumanSegmentationStencilMode

    The human segmentation stencil mode.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when setting the human segmentation stencil mode to enabled if the implementation does not support human segmentation.

    Methods

    CreateProvider()

    Create the implementation specific functionality provider.

    Declaration
    protected abstract XROcclusionSubsystem.Provider CreateProvider()
    Returns
    Type Description
    XROcclusionSubsystem.Provider

    The implementation specific functionality provider.

    GetMaterialKeywords(out List<String>, out List<String>)

    Get the enabled and disabled shader keywords for the material.

    Declaration
    public void GetMaterialKeywords(out List<string> enabledKeywords, out List<string> disabledKeywords)
    Parameters
    Type Name Description
    List<String> enabledKeywords

    The keywords to enable for the material.

    List<String> disabledKeywords

    The keywords to disable for the material.

    GetTextureDescriptors(Allocator)

    Gets the occlusion texture descriptors associated with the current AR frame.

    Declaration
    public NativeArray<XRTextureDescriptor> GetTextureDescriptors(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The allocator to use when creating the returned NativeArray.

    Returns
    Type Description
    NativeArray<XRTextureDescriptor>

    An array of texture descriptors.

    Remarks

    The caller owns the returned NativeArray and is responsible for calling Dispose on it.

    OnDestroyed()

    Destroy the subsystem by destroying the provider.

    Declaration
    protected override sealed void OnDestroyed()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XROcclusionSubsystemDescriptor>.OnDestroyed()

    OnStart()

    Start the subsystem by starting the provider.

    Declaration
    protected override sealed void OnStart()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XROcclusionSubsystemDescriptor>.OnStart()

    OnStop()

    Stop the subsystem by stopping the provider.

    Declaration
    protected override sealed void OnStop()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XROcclusionSubsystemDescriptor>.OnStop()

    Register(XROcclusionSubsystemCinfo)

    Register the descriptor for the occlusion subsystem implementation.

    Declaration
    public static bool Register(XROcclusionSubsystemCinfo occlusionSubsystemCinfo)
    Parameters
    Type Name Description
    XROcclusionSubsystemCinfo occlusionSubsystemCinfo

    The occlusion subsystem implementation construction information.

    Returns
    Type Description
    Boolean

    true if the descriptor was registered. Otherwise, false.

    TryAcquireHumanDepthCpuImage(out XRCpuImage)

    Tries to acquire the latest human depth CPU image.

    Declaration
    public bool TryAcquireHumanDepthCpuImage(out XRCpuImage cpuImage)
    Parameters
    Type Name Description
    XRCpuImage cpuImage

    If this method returns true, an acquired XRCpuImage. The CPU image must be disposed by the caller.

    Returns
    Type Description
    Boolean

    Returns true if an XRCpuImage was successfully acquired. Returns false otherwise.

    TryAcquireHumanStencilCpuImage(out XRCpuImage)

    Tries to acquire the latest human stencil CPU image.

    Declaration
    public bool TryAcquireHumanStencilCpuImage(out XRCpuImage cpuImage)
    Parameters
    Type Name Description
    XRCpuImage cpuImage

    If this method returns true, an acquired XRCpuImage. The CPU image must be disposed by the caller.

    Returns
    Type Description
    Boolean

    Returns true if an XRCpuImage was successfully acquired. Returns false otherwise.

    TryGetHumanDepth(out XRTextureDescriptor)

    Gets the human depth texture descriptor.

    Declaration
    public bool TryGetHumanDepth(out XRTextureDescriptor humanDepthDescriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor humanDepthDescriptor

    The human depth texture descriptor to be populated, if available from the provider.

    Returns
    Type Description
    Boolean

    true if the human depth texture descriptor is available and is returned. Otherwise, false.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the implementation does not support human depth texture.

    TryGetHumanStencil(out XRTextureDescriptor)

    Gets the human stencil texture descriptor.

    Declaration
    public bool TryGetHumanStencil(out XRTextureDescriptor humanStencilDescriptor)
    Parameters
    Type Name Description
    XRTextureDescriptor humanStencilDescriptor

    The human stencil texture descriptor to be populated, if available from the provider.

    Returns
    Type Description
    Boolean

    true if the human stencil texture descriptor is available and is returned. Otherwise, false.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the implementation does not support human stencil texture.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023