Getting VR (starter kit) to work on mobile devices


#1

Hi there,

Currently I’m working on a VR project for an architecture firm. The VR solution works fully as expected when using an Oculus Go, mobile-/cardboard vr has been a problem though…

Not getting it to work, we created a Test VR project using the VR starterkit provided by Playcanvas, but even this starter kit gives problems on mobile devices. The occulus handles it well, but starting the project through my phones browser (we tried Chrome, Firefox & Safari) gives an error saying webVrPolyfill is undefined.
The WebVrPolyfill function is included, however, the code looks a bit strange (all the code is on two very long lines) and also gives warnings. Commenting this out and enabling VR in the web-vr-ui initialize method instead of webvr-init results in a gray screen on mobile devices: Occulus Go still works fine.

A published version of the project:

I’ve read a lot about how WebVR is still very much a dynamic process in relation to Playcanvas, and that the plan was to include Polyfill into the engine itself, but most of those posts are almost a year old and I’m curious if there’s any updates I’ve missed or ideas of how to approach this problem.


#2

Hi @Cheffers,

I haven’t used that starter kit for a while, what I know is that the WebVrPolyfill has been removed from the engine, and the plan is that the developer himself loads it.

Here is the PR responsible for that:

I’d say try raising an issue to the engine github repo. It seems to be a compatibility issue to the engine.


#3

@Cheffers

Looking at your published build, I see that the Web VR init file has been commented out?

image

I’ve done a test build of the starter kit and it seems to work fine on Chrome on Android: https://playcanv.as/p/mMsDfk3P/