let canvas = document.querySelector("canvas");
gl = canvas.getContext("webgl", { xrCompatible: true });
setNewWebGLLayer();
function setNewWebGLLayer(gl) {
if (!gl) {
/* WebGL not available */
return;
}
xrSession.updateRenderState({
baseLayer: new XRWebGLLayer(xrSession, gl),
});
}XRRenderState: baseLayer property / notebook
XRRenderState: baseLayer property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.