MDN self-hosted library · e01.org
XRLightProbe / notebook

XRLightProbe

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const lightProbe = await xrSession.requestLightProbe();
js
const probePose = xrFrame.getPose(lightProbe.probeSpace, xrReferenceSpace);
js
const glBinding = new XRWebGLBinding(xrSession, gl);
const lightProbe = await xrSession.requestLightProbe();
let glCubeMap = glBinding.getReflectionCubeMap(lightProbe);

lightProbe.addEventListener("reflectionchange", () => {
  glCubeMap = glBinding.getReflectionCubeMap(lightProbe);
});