Skip to main content
Version: 14 Oct 2024

MagicLeapLightEstimationFeature

NameSpace: LightEstimation

Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature

Public Fields

LightEstimationCreated


public bool LightEstimationCreated { get; set; }


Public Methods

bool CheckEstimationEstimateReadiness

Determines if enough time has passed for a light estimation estimate to obtain data.

public bool CheckEstimationEstimateReadiness()

Returns: The readiness of the light estimation estimate.


void CreateLightEstimation

Creates a light estimation to enable light estimates to be created for a given cubemap resolution.

public void CreateLightEstimation(
HDRCubemapFaceResolution cubemapFaceResolution
)

Parameters

TypeNameDescription
HDRCubemapFaceResolutioncubemapFaceResolutionThe width/height resolution of the face of the cubemap to be used.

void DestroyLightEstimation

Destroys the active light estimation so light estimates can no longer be created.

public void DestroyLightEstimation()

Cubemap GetEstimateCubemap

Gets a Unity Cubemap object from a light estimate's cubemap data.

public Cubemap GetEstimateCubemap(
float [] rawPixelsArray,
int faceDim
)

Parameters

TypeNameDescription
float []rawPixelsArrayThe float array of pixels obtained from a light estimation estimate.
intfaceDimThe desired width/height dimension of each face of the cubemap.

Returns: A cubemap object from the light estimate data in a format usable by Unity.


long GetLastUpdateTime

Gets the last time that the light estimation state was updated.

public long GetLastUpdateTime()

Returns: The time of last update in nanoseconds.


EstimateData GetLightEstimationEstimateData

Creates a light estimation estimate, obtains the light estimate data, then destroys the light estimate.

public EstimateData GetLightEstimationEstimateData()

Returns: The data obtained from a light estimation estimate.


Protected Methods

OnInstanceCreate

protected override bool OnInstanceCreate(
ulong xrInstance
)

Parameters

TypeNameDescription
ulongxrInstance

Public Attributes

ExtensionName


public const string ExtensionName = "XR_ML_light_estimation";


FeatureId


public const string FeatureId = "com.magicleap.openxr.feature.ml2_lightestimation";


Protected Attributes

UsesExperimentalExtensions


protected override bool UsesExperimentalExtensions => true;