Skip to main content
API Reference NianticSpatial.NSDK.AR.Occlusion

NsdkOcclusionExtension

↳ extends CompositeRenderer

Declaration

public partial class NsdkOcclusionExtension : CompositeRenderer

Summary

This component allows configuration of the additional functionality available in NSDK's implementation of XROcclusionSubsystem.


Properties

NameTypeSummary
BypassOcclusionManagerUpdatesbool
Whether to disable automatically updating the depth texture of the occlusion manager.
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.
CustomMaterialMaterial
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 DepthTextureTexture2D
Returns the raw depth texture used in rendering.
readonly DepthTransformMatrix4x4
Returns a transform for converting between normalized image coordinates and a coordinate space
appropriate for rendering DepthTexture on the viewport.
IsOcclusionStabilizationEnabledbool
Get or set whether meshing based occlusion stabilization is enabled.
IsOcclusionSuppressionEnabledbool
Get or set whether semantic segmentation based occlusion suppression is enabled.
readonly IsRenderingActivebool
Whether the second pass of background rendering is active to satisfy custom occlusion features.
readonly LatestExtrinsicsMatrixNullable<Matrix4x4>
Returns the extrinsics matrix for DepthTexture.
readonly LatestIntrinsicsMatrixNullable<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.
OcclusionDistanceModeOptimalOcclusionDistanceMode
Get or set the current mode in use for determining the distance at which occlusions
will have the best visual quality.
OverrideOcclusionManagerSettingsbool
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.
PreferSmoothEdgesbool
When enabled, the depth image will be sampled bilinearly during rendering.
StabilizationThresholdfloat
The stabilization threshold determines whether to prefer per-frame (0)
or fused depth (1) during occlusion stabilization.
StableDepthMaterialMaterial
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 SupportsTargetFrameRatebool
Determines whether the TargetFrameRate API is supported with the current configuration.
TargetFrameRateuint
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.
Visualizationbool
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

NameTypeSummary
AddSceneSegmentationSuppressionChannelbool
Adds a semantic segmentation channel to the collection of channels that are suppressed in the depth buffer.
RemoveSceneSegmentationSuppressionChannelbool
Removes a semantic segmentation channel, if it exists, from the collection of channels
that are suppressed in the depth buffer.
TrackOccludeevoid
Sets the principal virtual object being occluded in the SpecifiedGameObject occlusion mode.
This method changes the optimal occlusion distance mode setting.>
TryGetDepthbool
Returns the metric eye depth at the specified pixel coordinates.