Skip to main content
Version: 3.1

class LightshipOcclusionExtension

(Niantic.Lightship.AR.Occlusion.LightshipOcclusionExtension)

Overview

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

	class LightshipOcclusionExtension: MonoBehaviour {
public:

enumOptimalOcclusionDistanceMode;

// fields

static const string occlusionExtensionShaderName = k_LightshipOcclusionExtensionShaderName;

// properties

uint TargetFrameRate;
Matrix4x4? LatestIntrinsicsMatrix;
OptimalOcclusionDistanceMode Mode;
bool IsOcclusionSuppressionEnabled;
bool IsOcclusionStabilizationEnabled;
float StabilizationThreshold;
bool UseCustomBackgroundMaterial;
Material CustomBackgroundMaterial;
bool IsRenderingActive;
bool Visualization;
Material BackgroundMaterial;

// methods

bool AddSemanticSuppressionChannel(string channelName);
void RemoveSemanticSuppressionChannel(string channelName);
void TrackOccludee(Renderer occludee);
};

Detailed Documentation

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

Fields

occlusionExtensionShaderName

static const string occlusionExtensionShaderName = k_LightshipOcclusionExtensionShaderName

Name of the default Lightship Occlusion Extension shader.

Properties

TargetFrameRate

uint TargetFrameRate

Get or set the frame rate that depth inference will aim to run at

LatestIntrinsicsMatrix

Matrix4x4? LatestIntrinsicsMatrix

Returns the intrinsics matrix of the most recent semantic segmentation prediction. 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.

The intrinsics matrix.

    Parameters:

    System.NotSupportedException - Thrown if getting intrinsics matrix is not supported.

Mode

OptimalOcclusionDistanceMode Mode

Get or set the current mode in use for determining the distance at which occlusions will have the best visual quality.

IsOcclusionSuppressionEnabled

bool IsOcclusionSuppressionEnabled

Get or set whether semantic segmentation based occlusion suppression is enabled.

IsOcclusionStabilizationEnabled

bool IsOcclusionStabilizationEnabled

Get or set whether meshing based occlusion stabilization is enabled.

StabilizationThreshold

float StabilizationThreshold

Whether to prefer per-frame (0) or fused depth (1) during stabilization.

UseCustomBackgroundMaterial

bool UseCustomBackgroundMaterial

Get or set whether to use the custom material for processing the AR background depth buffer.

CustomBackgroundMaterial

Material CustomBackgroundMaterial

Get or set the custom material used for processing the AR background depth buffer.

IsRenderingActive

bool IsRenderingActive

Whether the second pass of background rendering is active to satisfy custom occlusion features.

Visualization

bool Visualization

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.

BackgroundMaterial

Material BackgroundMaterial

The background rendering material in use.

    Parameters:

    InvalidOperationException -

Methods

AddSemanticSuppressionChannel

bool AddSemanticSuppressionChannel(string channelName)

Adds a semantic segmentation channel to the collection of channels that are suppressed in the depth buffer.

    Parameters:

    channelName - Semantic segmentation channel to add

    Returns:

    True if the channel was successfully added.

RemoveSemanticSuppressionChannel

void RemoveSemanticSuppressionChannel(string channelName)

Removes a semantic segmentation channel, if it exists, from the collection of channels that are suppressed in the depth buffer.

    Parameters:

    channelName - Semantic segmentation channel to remove

    Returns:

    

TrackOccludee

void TrackOccludee(Renderer occludee)

Sets the principal virtual object being occluded in the SpecifiedGameObject occlusion mode

.. note::

This method changes the optimal occlusion distance mode setting.