Class ARShaderOcclusion
Add this component alongside AROcclusionManager
to copy the depth camera's texture into shader memory.
Inherited Members
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.XR.ARFoundation
Assembly: Unity.XR.ARFoundation.dll
Syntax
[DisallowMultipleComponent]
[RequireComponent(typeof(AROcclusionManager))]
[AddComponentMenu("XR/AR Foundation/AR Shader Occlusion")]
public class ARShaderOcclusion : MonoBehaviour
Properties
environmentDepthProjectionMatricesPropertyId
Shader property ID for the depth view-projection matrix array.
Declaration
public int environmentDepthProjectionMatricesPropertyId { get; }
Property Value
Type | Description |
---|---|
int |
hardOcclusionShaderKeyword
The shader keyword to enable hard occlusion.
Declaration
public string hardOcclusionShaderKeyword { get; }
Property Value
Type | Description |
---|---|
string |
ndcLinearConversionParametersPropertyId
Shader property ID for Vector2 with parameters for conversion depth between NDC and linear.
Declaration
public int ndcLinearConversionParametersPropertyId { get; }
Property Value
Type | Description |
---|---|
int |
occlusionShaderMode
Enables a global shader keyword to enable hard or soft occlusion. To implement occlusion in your app, use a provided URP shader or modify your custom shader to support hardOcclusionShaderKeyword and/or softOcclusionShaderKeyword keywords.
Declaration
public AROcclusionShaderMode occlusionShaderMode { get; set; }
Property Value
Type | Description |
---|---|
AROcclusionShaderMode |
softOcclusionShaderKeyword
The shader keyword to enable soft occlusions.
Declaration
public string softOcclusionShaderKeyword { get; }
Property Value
Type | Description |
---|---|
string |
Events
occlusionSourceSet
Event triggered when an occlusion source is set or updated.
Declaration
public event EventHandler<AROcclusionSourceEventArgs> occlusionSourceSet
Event Type
Type | Description |
---|---|
EventHandler<AROcclusionSourceEventArgs> |