Hi! I’m experiencing problems trying to create an AR application. Everything was working fine, but today, I was working on the project and when I try to activate the camera to enter into the AR mode, it doesn’t work.
I tried to change the navigator (I tried Brave, Firefox and Chrome) and nothing works. Also tried different devices and also doesn’t work. I’ve created a new project with the template of ‘WebXR AR Starter Kit’ and when I try to activate the camera, gives the following error:
[playcanvas-1.63.4.js:67268]: Failed to construct ‘XRWebGLLayer’: WebGL context must be marked as XR compatible in order to use with an immersive XRSession.
I might have found a temporary solution waiting for the pull request’s merge that fixes the issue.
It is to manually make xr compatible from the app webgl before starting the xr from the camera.
const gl = this.app.graphicsDevice.gl;
await gl.makeXRCompatible();
// camera startXr