[SOLVED] WebVR Polyfill error after Update

Following the issue of the WebXR update - error, which might be related:
I still get this error for my webVR Project after the last update. I use the WebVRPolyfill for all mobile devices (including android).
It might be a specific project / rendering configuration, as I had issues with native xr as well (which led me to switching entirely to the polyfill). It’s a rather large project, but I could make it temporarely public if it could help.

playcanvas-stable.dbg.js:15416 Uncaught TypeError: viewMat3L.setFromMat4 is not a function
    at ForwardRenderer.setCamera (playcanvas-stable.dbg.js:15416)
    at ForwardRenderer.renderComposition (playcanvas-stable.dbg.js:17506)
    at Application.render (playcanvas-stable.dbg.js:62033)
    at playcanvas-stable.dbg.js:62735

Can you reproduce this on PC/Mac as well? If yes, please add me to your project, I’ll have a quick look if that’s ok. My user name: mvaligursky

Ok - I’ve created now a completely reduced scene - only including the basic vr-setup.
I’ve also integrated the current version of the webVR Polyfill (as I did some minor modifications there within my project).

See the public project:
https://playcanvas.com/editor/project/755352
and build:

Currently I use the webVR Polyfill also on android, using this at vr.js | line 96

if (this.app.xr.isAvailable(pc.XRTYPE_VR) && false) {

This results in the errors, I mentioned above.

If I use webXR native on my Samsung S10 I get following error, after the view changes to stereo mode: The website is not responding.

Any help would be very appreciated.

I’m a bit confused. Why are you using the WebVR polyfill with a WebXR application?

The problem was that on my S10 the native xr version didn’t work, like I mentioned before this resulted in a freeze “website is not responding”
Therefore I routed all my webVR stuff over the webVRPolyfill, also to have a consistent experience for iOs and Android (showing the cardboard-info there as well)

What was wrong with the WebXR polyfill?

Just to be clear, WebVR and WebXR are two separate APIs and AFAIK, not compatible with each other.

You are right. If I can manage to get the WebVR Polyfill running again, I will stick with WebVR and the WebVR Polyfill. After the core errors I got today I thought I would had to switch to WebXR and the WebXR Polyfill.
The problem with the WebXR Polyfill is, that I haven’t managed to “force” it’s use also on android, which was very simple with the WebVR Polyfill.
With WebXR I also have rewrite & test some parts, like the VR Magic Window mode from my other post.

Do you have any WebVR projects / starter templates, which are still working with the WebVR Polyfill? I’m just wondering as none of my WebVR projects seem to be working.

I haven’t checked this recently, but I restored the old WebVR starter kit just in case last year when we did the switch to WebXR.

https://playcanvas.com/project/721677/overview/starter-kit-webvr

1 Like

Thank you very much. I’ve checked it on my phone, and I get the same errors:

‘Uncaught TypeError: viewMat3L.setFromMat4 is not a function
at ForwardRenderer.setCamera (playcanvas-stable.dbg.js:15416)
at ForwardRenderer.renderComposition (playcanvas-stable.dbg.js:17506)
at Application.render (playcanvas-stable.dbg.js:62033)
at playcanvas-stable.dbg.js:62735’

I think the WebXR Polyfill is now the only way to go. But thanks again for your time.

That’s starting to look like a bug in our engine. I or Martin (@mvaligursky) will take a look as soon as we can.

1 Like

Thank you very much. If I can provide any help (testing on different devices or else), just let me know.

Ah yeah. viewMat3L is a Mat4, not a Mat3. Whoops. :smile:

1 Like

Fixed is now deployed @Rechi:

2 Likes

Thanks for the quick fix, I will check with the older version of my project (as I’m currently updating everything to the webXR api), but I think that should solve it. Thanks.

1 Like

I love this dev team who can fix bugs so quickly! Thank you @will and @yaustar for your support! :heart_eyes:

3 Likes