Class XROcclusionSubsystem.Provider
The provider which will service the XROcclusionSubsystem.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public abstract class XROcclusionSubsystem.Provider : SubsystemProvider<XROcclusionSubsystem>
Properties
currentEnvironmentDepthMode
Property to be implemented by the provider to get the environment depth mode currently in use.
Declaration
public virtual EnvironmentDepthMode currentEnvironmentDepthMode { get; }
Property Value
Type | Description |
---|---|
EnvironmentDepthMode | The current environment depth mode. |
currentHumanDepthMode
Property to be implemented by the provider to get the human segmentation depth mode currently in use.
Declaration
public virtual HumanSegmentationDepthMode currentHumanDepthMode { get; }
Property Value
Type | Description |
---|---|
HumanSegmentationDepthMode | The current human segmentation depth mode. |
currentHumanStencilMode
Property to be implemented by the provider to get the segmentation stencil mode currently in use.
Declaration
public virtual HumanSegmentationStencilMode currentHumanStencilMode { get; }
Property Value
Type | Description |
---|---|
HumanSegmentationStencilMode |
currentOcclusionPreferenceMode
Get the occlusion preference mode currently in use by the provider.
Declaration
public virtual OcclusionPreferenceMode currentOcclusionPreferenceMode { get; }
Property Value
Type | Description |
---|---|
OcclusionPreferenceMode | The current occlusion preference mode. |
depthViewProjectionMatricesPropertyId
Shader property ID for the depth view-projection matrix array.
Any ARShaderOcclusion
components in your scene will write to this property.
Declaration
public virtual int depthViewProjectionMatricesPropertyId { get; }
Property Value
Type | Description |
---|---|
int |
environmentDepthConfidenceCpuImageApi
The API for interacting with an XRCpuImage acquired with TryAcquireEnvironmentDepthConfidenceCpuImage(out Cinfo).
Declaration
public virtual XRCpuImage.Api environmentDepthConfidenceCpuImageApi { get; }
Property Value
Type | Description |
---|---|
XRCpuImage.Api | The environment depth confidence CPU image API. |
environmentDepthCpuImageApi
The API for interacting with an XRCpuImage acquired with TryAcquireEnvironmentDepthCpuImage(out Cinfo).
Declaration
public virtual XRCpuImage.Api environmentDepthCpuImageApi { get; }
Property Value
Type | Description |
---|---|
XRCpuImage.Api | The environment depth CPU image API. |
environmentDepthTemporalSmoothingEnabled
Property to be implemented by the provider to get whether temporal smoothing is currently applied to the environment depth image.
Declaration
public virtual bool environmentDepthTemporalSmoothingEnabled { get; }
Property Value
Type | Description |
---|---|
bool | true if environment depth temporal smoothing is enabled. Otherwise, false. |
environmentDepthTemporalSmoothingRequested
Property to be implemented by the provider to get whether temporal smoothing has been requested for the environment depth image.
Declaration
public virtual bool environmentDepthTemporalSmoothingRequested { get; set; }
Property Value
Type | Description |
---|---|
bool | true if environment depth temporal smoothing is requested. Otherwise, false. |
humanDepthCpuImageApi
The API for interacting with an XRCpuImage acquired with TryAcquireHumanDepthCpuImage(out Cinfo).
Declaration
public virtual XRCpuImage.Api humanDepthCpuImageApi { get; }
Property Value
Type | Description |
---|---|
XRCpuImage.Api | The human depth CPU image API. |
humanStencilCpuImageApi
The API for interacting with an XRCpuImage acquired with TryAcquireHumanStencilCpuImage(out Cinfo).
Declaration
public virtual XRCpuImage.Api humanStencilCpuImageApi { get; }
Property Value
Type | Description |
---|---|
XRCpuImage.Api | The human stencil CPU image API. |
requestedEnvironmentDepthMode
Property to be implemented by the provider to get or set the environment depth mode.
Declaration
public virtual EnvironmentDepthMode requestedEnvironmentDepthMode { get; set; }
Property Value
Type | Description |
---|---|
EnvironmentDepthMode | The requested environment depth mode. |
requestedHumanDepthMode
Property to be implemented by the provider to get or set the requested human segmentation depth mode.
Declaration
public virtual HumanSegmentationDepthMode requestedHumanDepthMode { get; set; }
Property Value
Type | Description |
---|---|
HumanSegmentationDepthMode | The requested human segmentation depth mode. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when setting the human segmentation depth mode
to |
requestedHumanStencilMode
Property to be implemented by the provider to get or set the requested human segmentation stencil mode.
Declaration
public virtual HumanSegmentationStencilMode requestedHumanStencilMode { get; set; }
Property Value
Type | Description |
---|---|
HumanSegmentationStencilMode | The requested human segmentation stencil mode. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when setting the human segmentation stencil mode
to |
requestedOcclusionPreferenceMode
Specifies the requested occlusion preference mode.
Declaration
public virtual OcclusionPreferenceMode requestedOcclusionPreferenceMode { get; set; }
Property Value
Type | Description |
---|---|
OcclusionPreferenceMode | The requested occlusion preference mode. |
Methods
GetMaterialKeywords(out List<string>, out List<string>)
Method to be implemented by the provider to get the enabled and disabled shader keywords for the material.
Declaration
[Obsolete("GetMaterialKeywords(out List<string>, out List<string>) has been deprecated in AR Foundation version 6.0. Use GetShaderKeywords() instead.")]
public virtual 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. |
GetShaderKeywords()
Get the enabled and disabled shader keywords for the material.
Declaration
public virtual ShaderKeywords GetShaderKeywords()
Returns
Type | Description |
---|---|
ShaderKeywords | The enabled and disabled shader keywords for the Material. |
GetTextureDescriptors(XRTextureDescriptor, Allocator)
Method to be implemented by the provider to get the occlusion texture descriptors associated with the current AR frame.
Declaration
public virtual NativeArray<XRTextureDescriptor> GetTextureDescriptors(XRTextureDescriptor defaultDescriptor, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRTextureDescriptor | defaultDescriptor | The default descriptor value. |
Allocator | allocator | The allocator to use when creating the returned |
Returns
Type | Description |
---|---|
NativeArray<XRTextureDescriptor> | An array of the occlusion texture descriptors. |
TryAcquireEnvironmentDepthConfidenceCpuImage(out Cinfo)
Tries to acquire the latest environment depth confidence CPU image.
Declaration
public virtual bool TryAcquireEnvironmentDepthConfidenceCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | Construction information for an XRCpuImage, if this method returns true. |
Returns
Type | Description |
---|---|
bool | true if the environment depth confidence CPU image was acquired. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support environment depth confidence CPU images. |
TryAcquireEnvironmentDepthCpuImage(out Cinfo)
Tries to acquire the latest environment depth CPU image.
Declaration
public virtual bool TryAcquireEnvironmentDepthCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | Construction information for an XRCpuImage, if this method returns true. |
Returns
Type | Description |
---|---|
bool | true if the environment depth CPU image was acquired. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support environment CPU images. |
TryAcquireHumanDepthCpuImage(out Cinfo)
Tries to acquire the latest human depth CPU image.
Declaration
public virtual bool TryAcquireHumanDepthCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | The construction information for an XRCpuImage, if this method returns true. |
Returns
Type | Description |
---|---|
bool | true if the human depth CPU image was acquired. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support human depth CPU images. |
TryAcquireHumanStencilCpuImage(out Cinfo)
Tries to acquire the latest human stencil CPU image.
Declaration
public virtual bool TryAcquireHumanStencilCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | If this method returns |
Returns
Type | Description |
---|---|
bool | true if the human stencil CPU image was acquired. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support human stencil CPU images. |
TryAcquireRawEnvironmentDepthCpuImage(out Cinfo)
Tries to acquire the latest environment depth CPU image.
Declaration
public virtual bool TryAcquireRawEnvironmentDepthCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | Construction information for an XRCpuImage, if this method returns true. |
Returns
Type | Description |
---|---|
bool | true if the raw environment depth CPU image was acquired. Otherwise, false. |
Remarks
This method differs from TryAcquireEnvironmentDepthCpuImage(out Cinfo) in that it always tries to acquire the raw depth image, whereas the image provided by TryAcquireEnvironmentDepthCpuImage(out Cinfo) depends on the value of environmentDepthTemporalSmoothingEnabled.
TryAcquireSmoothedEnvironmentDepthCpuImage(out Cinfo)
Tries to acquire the latest smoothed environment depth CPU image.
Declaration
public virtual bool TryAcquireSmoothedEnvironmentDepthCpuImage(out XRCpuImage.Cinfo cinfo)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Cinfo | cinfo | Construction information for an |
Returns
Type | Description |
---|---|
bool | true if the smoothed environment depth CPU image was acquired. Otherwise, false. |
Remarks
This method differs from TryAcquireEnvironmentDepthCpuImage(out Cinfo) in that it always tries to acquire the smoothed depth image, whereas the image provided by TryAcquireEnvironmentDepthCpuImage(out Cinfo) depends on the value of environmentDepthTemporalSmoothingEnabled.
TryGetEnvironmentDepth(out XRTextureDescriptor)
Method to be implemented by the provider to get the environment depth texture descriptor.
Declaration
public virtual bool TryGetEnvironmentDepth(out XRTextureDescriptor environmentDepthDescriptor)
Parameters
Type | Name | Description |
---|---|---|
XRTextureDescriptor | environmentDepthDescriptor | The environment depth texture descriptor to be populated, if available. |
Returns
Type | Description |
---|---|
bool | true if the environment depth texture descriptor is available and returned. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support environment depth texture. |
TryGetEnvironmentDepthConfidence(out XRTextureDescriptor)
Method to be implemented by the provider to get the environment depth confidence texture descriptor.
Declaration
public virtual bool TryGetEnvironmentDepthConfidence(out XRTextureDescriptor environmentDepthConfidenceDescriptor)
Parameters
Type | Name | Description |
---|---|---|
XRTextureDescriptor | environmentDepthConfidenceDescriptor | The environment depth texture descriptor to be populated, if available. |
Returns
Type | Description |
---|---|
bool | true if the environment depth confidence texture descriptor is available and returned. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support environment depth confidence texture. |
TryGetFrame(Allocator, out XROcclusionFrame)
Get the current occlusion frame.
Declaration
public virtual XRResultStatus TryGetFrame(Allocator allocator, out XROcclusionFrame frame)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocator to use for any NativeArray_1s contained in the frame. |
XROcclusionFrame | frame | The output occlusion frame, if this method returned true. |
Returns
Type | Description |
---|---|
XRResultStatus | true if the method successfully got a frame. Otherwise, false. |
TryGetHumanDepth(out XRTextureDescriptor)
Method to be implemented by the provider to get the human depth texture descriptor.
Declaration
public virtual bool TryGetHumanDepth(out XRTextureDescriptor humanDepthDescriptor)
Parameters
Type | Name | Description |
---|---|---|
XRTextureDescriptor | humanDepthDescriptor | The human depth texture descriptor to be populated, if available. |
Returns
Type | Description |
---|---|
bool | true if the human depth texture descriptor is available and returned. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support human depth texture. |
TryGetHumanStencil(out XRTextureDescriptor)
Method to be implemented by the provider to get the human stencil texture descriptor.
Declaration
public virtual bool TryGetHumanStencil(out XRTextureDescriptor humanStencilDescriptor)
Parameters
Type | Name | Description |
---|---|---|
XRTextureDescriptor | humanStencilDescriptor | The human stencil texture descriptor to be populated, if available. |
Returns
Type | Description |
---|---|
bool | true if the human stencil texture descriptor is available and returned. Otherwise, false. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown if the implementation does not support human stencil texture. |