Table of Contents

Class XRLightEstimate

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The XRLightEstimate interface of the WebXR Device API provides the estimated lighting values for an XRLightProbe at the time represented by an XRFrame.
[Value("XRLightEstimate")]
public class XRLightEstimate
Inheritance
XRLightEstimate
Inherited Members

Remarks

To get an XRLightEstimate object, call the GetLightEstimate(XRLightProbe) method.

-GetLightEstimate(XRLightProbe)

See also on MDN

Constructors

XRLightEstimate()

public XRLightEstimate()

Properties

PrimaryLightDirection

NOTE
Experimental
The read-only primaryLightDirection property of the XRLightEstimate interface returns a DOMPointReadOnly representing the direction to the primary light source from the probeSpace of an XRLightProbe.
[Value("primaryLightDirection")]
public DOMPointReadOnly PrimaryLightDirection { get; }

Property Value

DOMPointReadOnly

A DOMPointReadOnly object. If no estimated values from the user's environment are available, the point will be { x: 0.0, y: 1.0, z: 0.0, w: 0.0 }, representing a light shining straight down from above.

Remarks

PrimaryLightIntensity

NOTE
Experimental
The read-only primaryLightIntensity property of the XRLightEstimate interface returns a DOMPointReadOnly representing the intensity of the primary light source from the probeSpace of an XRLightProbe.
[Value("primaryLightIntensity")]
public DOMPointReadOnly PrimaryLightIntensity { get; }

Property Value

DOMPointReadOnly

A DOMPointReadOnly object where an RGB value is mapped to the x, y, and z values. The w value is always 1.0. If no estimated values from the user's environment are available, the point will be {x: 0.0, y: 0.0, z: 0.0, w: 1.0}, representing no illumination.

Remarks

SphericalHarmonicsCoefficients

NOTE
Experimental
The read-only sphericalHarmonicsCoefficients property of the XRLightEstimate interface returns a {{jsxref("Float32Array")}} containing 9 spherical harmonics coefficients.
[Value("sphericalHarmonicsCoefficients")]
public Float32Array SphericalHarmonicsCoefficients { get; }

Property Value

Float32Array

A Float32Array containing 9 spherical harmonics coefficients. The array contains 27 elements in total, with every 3 elements defining red, green, and blue components for each coefficient.The first 3 elements must be a valid lighting estimate component; the rest may be 0 due to privacy settings or limitations of the device to provide more data.

Remarks

Spherical harmonic lighting is a technique that uses spherical functions instead of standard lighting equations. See Wikipedia for more information.

-GetLightEstimate(XRLightProbe)

See also on MDN