NsdkOcclusionExtension
↳ extends CompositeRenderer
Declaration
public partial class NsdkOcclusionExtension : CompositeRendererSummary
This component allows configuration of the additional functionality available in NSDK's implementation of XROcclusionSubsystem.
Properties
| Name | Type | Summary |
|---|---|---|
| BypassOcclusionManagerUpdates | bool | |
| CustomMaterial | Material | Get or set the custom material used for processing the AR background depth buffer. If set to null, the default material will be used. |
| readonly DepthTexture | Texture2D | Returns the raw depth texture used in rendering. |
| readonly DepthTransform | Matrix4x4 | Returns a transform for converting between normalized image coordinates and a coordinate space appropriate for rendering DepthTexture on the viewport. |
| IsOcclusionStabilizationEnabled | bool | Get or set whether meshing based occlusion stabilization is enabled. |
| IsOcclusionSuppressionEnabled | bool | Get or set whether semantic segmentation based occlusion suppression is enabled. |
| readonly IsRenderingActive | bool | Whether the second pass of background rendering is active to satisfy custom occlusion features. |
| readonly LatestExtrinsicsMatrix | Nullable<Matrix4x4> | Returns the extrinsics matrix for DepthTexture. |
| readonly LatestIntrinsicsMatrix | Nullable<Matrix4x4> | Returns the intrinsics matrix for DepthTexture. Contains values for the camera's focal length and principal point. Converts between 2D image pixel coordinates and 3D world coordinates relative to the camera. |
| OcclusionDistanceMode | OptimalOcclusionDistanceMode | Get or set the current mode in use for determining the distance at which occlusions will have the best visual quality. |
| OverrideOcclusionManagerSettings | bool | Whether to override the occlusion manager's settings to set the most optimal configuration for the occlusion extension. Currently, the following overrides are applied: 1) On iPhone devices with Lidar sensor, the best and medium occlusion mode will cause a significant performance hit as well as a crash. We will override the occlusion mode to fastest to avoid this issue and enable smooth edges for the best results. 2) The occlusion preference mode is set to NoOcclusion when the occlusion extension is active. |
| PreferSmoothEdges | bool | When enabled, the depth image will be sampled bilinearly during rendering. |
| StabilizationThreshold | float | The stabilization threshold determines whether to prefer per-frame (0) or fused depth (1) during occlusion stabilization. |
| StableDepthMaterial | Material | Get or set the material used for rendering the fused depth texture. This is relevant when the occlusion stabilization feature is enabled. The shader used by this material should output metric eye depth. |
| readonly SupportsTargetFrameRate | bool | Determines whether the TargetFrameRate API is supported with the current configuration. |
| TargetFrameRate | uint | The framerate that depth inference will aim to run at. Setting the value to 0 will result in using the recommended frame rate. Call SupportsTargetFrameRate to check if the target frame rate is supported. |
| Visualization | bool | When enabled, the component displays the depth image used for occlusions. Note that visualization can only be used if a custom occlusion feature is active, e.g. suppression or stabilization. |
Methods
| Name | Type | Summary |
|---|---|---|
| AddSceneSegmentationSuppressionChannel | bool | Adds a semantic segmentation channel to the collection of channels that are suppressed in the depth buffer. |
| RemoveSceneSegmentationSuppressionChannel | bool | Removes a semantic segmentation channel, if it exists, from the collection of channels that are suppressed in the depth buffer. |
| TrackOccludee | void | Sets the principal virtual object being occluded in the SpecifiedGameObject occlusion mode. This method changes the optimal occlusion distance mode setting.> |
| TryGetDepth | bool | Returns the metric eye depth at the specified pixel coordinates. |
This feature can be used to avoid redundant texture operations since depth is ultimately
going to be overriden by the NSDK Occlusion Extension anyway. Not using this setting
may result in undesired synchronization with the rendering thread that impacts performance.