WebXR Lighting Estimation API
Jump to navigation
Jump to search
Status | WD |
---|---|
Last Updated | 3 June 2022 |
Editor(s) | Brandon Jones |
Former Editor(s) | Kearwood Gilbert |
CG or WG? | WG |
The WebXR Lighting Estimation API enables support for exposing estimates of environmental lighting conditions to WebXR sessions.
WebIDL[edit]
[SecureContext, Exposed=Window]
interface XRLightProbe : EventTarget {
readonly attribute XRSpace probeSpace;
attribute EventHandler onreflectionchange;
};
enum XRReflectionFormat {
"srgba8",
"rgba16f",
};
[SecureContext, Exposed=Window]
interface XRLightEstimate {
readonly attribute Float32Array sphericalHarmonicsCoefficients;
readonly attribute DOMPointReadOnly primaryLightDirection;
readonly attribute DOMPointReadOnly primaryLightIntensity;
};
dictionary XRLightProbeInit {
XRReflectionFormat reflectionFormat = "srgba8";
};
partial interface XRSession {
Promise<XRLightProbe> requestLightProbe(optional XRLightProbeInit options = {});
readonly attribute XRReflectionFormat preferredReflectionFormat;
};
partial interface XRFrame {
XRLightEstimate? getLightEstimate(XRLightProbe lightProbe);
};
partial interface XRWebGLBinding {
WebGLTexture? getReflectionCubeMap(XRLightProbe lightProbe);
};