playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.59k stars 1.34k forks source link

WebVR does not work on Chrome 56 #859

Closed renatoruk closed 6 years ago

renatoruk commented 7 years ago

After updating mobile Chrome on Android to version 56, none of the examples on the demo page nor the WebVR project we are developing (it was forked from the base VR project) work anymore.

We need to use the WebVR functionality with third party headsets that do not have a clicker button, so the expected behavior is that the screen splits into two halves without the need to use the supported headset. (e.g. Daydream or Vive)

The error we're getting is No VR display or headset is detected., although the same code worked on Chrome 55, just before the update.

I presume that the issue here is that WebVR is supported in Chrome 56, but since the headset is not actually connected, it shows the correct error.

yaustar commented 7 years ago

This is an issue that I'm currently looking into as it is currently affecting all WebVR demos that I've tried (three.js and the examples on webvr.info) do not work unless polyfill is forced.

Yes, you are correct that since Chrome 56 now has implemented the WebVR API, polyfill is no longer needed. The issue is that only a small number of devices (I'm assuming the Daydream supported devices) are deemed to a be a compatible display for use with WebVR.

Maksims commented 7 years ago

Just to clarify - this is due to polyfill assumed all mobile devices are VR capable. But WebVR has different assumptions about devices, so pretty much all non-daydream mobile phones didn't get VR love :)

Here is that issue discussion on https://github.com/googlevr/webvr-polyfill/issues/177

renatoruk commented 7 years ago

@yaustar, @Maksims thank you guys for clarifying this. Will follow the thread from now on.

Do you plan on adding any modifications to the WebVR polyfill included in Playcanvas before the official fix is out?

Maksims commented 7 years ago

Currently you could enforce loading polyfill for mobile, unless you know it is Daydream compatible device.

It is still not clear where vendors will go, either they will never add support for before-daydream mobiles, or they will in future - not clear.

I personally believe it is good thing, as experience and performance on before-daydream mobiles is too poor, and this leads to bad experience for users. But of course delays Mobile VR accessibility by quiet a bit of time.

renatoruk commented 7 years ago

Since Playcanvas source is not available through online code editor, where could I force usage of the webvr polyfill?

Maksims commented 7 years ago

You could override property on pc.VrManager which called isSupported to return false in cases where it is true but you still want to enforce polyfill to get loaded. This should be done before app starts loading stuff, which would be in loading script perhaps.

daveranan commented 7 years ago

I'm a bit confused, not sure if this is a bug or what not. If you open any WebGL demo, i.e. WebVR 360 Image by itself in Chrome 56, VR & Gyroscope do not work. All you can do is tap/click & drag the screen to look around.

But, if you open any of tutorials page, i.e. WebVR 360 Image Tutorial Page, VR button & Gyroscope are fully functional and work perfectly like they were used to.

I connected my android phone to mac, inspected the page to see if there are any error differences, but there were none. Same errors.

Am I'm missing something here?

yaustar commented 7 years ago

It's a http/https difference. WebVR is only natively enabled on webpages that are on the Origin Trial and only on https.

The tutorials pages are on http so WebVR isn't natively enabled and the polyfill is used instead.

So if you load http://playcanv.as/p/v6qoi4Yt/ (note it's on http), it will 'work' via the polyfill.

daveranan commented 7 years ago

Even as a web dev, I wouldn't have thought that https would be such an issue. Thanks for pointing that out @yaustar, have been trying to debug this all morning.

daveranan commented 7 years ago

Here's another bug, not really sure it's a bug or not. So I forked the 360 VR image tutorial project, and was expecting same results as on the tutorial project, but it just shows brown/red background in VR instead. Link: https://playcanv.as/p/2EMTn1Dv/

Also, why the User Experience is different on iOS devices vs Android? On Android you have option to turn on the VR. But by default you can use gyroscope to move camera around. On iOS it forces you to use phone in cardboard mode, otherwise it will not work.

bjsommer commented 7 years ago

Hi together, thanks for this thread! I experienced the same problem when using the samples from webvr.info: https://webvr.info/developers/ When I used the standard version of the actual Chrome 56, the demos did not start. But then I did the following: downloaded Chrome Beta (58.0.3029.82) When I started the demos, I got a message that google vr services have to be installed. After I did this, all demos worked again :-) In addition, I have of course the Cardboard app (4.2) installed on Android version 6.0.1 (security patch 1.12.2016)

daredevildave commented 7 years ago

Hi @renatoruk, can you confirm if this is still an issue for you? And if so, on which devices?

There are differences in the way Android behaves on different devices. In particular Daydream-ready devices (Google Pixel phones) can handle WebVR natively, but other devices do not.

renatoruk commented 7 years ago

Hello @daredevildave, yes, webVR is functional now in Chrome 57 on Android. I tested on Samsung Galaxy S7 so it probably ran the polyfill version.

Dhellblazer commented 7 years ago

Hi, I have a problem when viewing webVr content in chrome 58 (Android), the image comes out reduced to a very small box in the bottom left.

Maksims commented 7 years ago

@Dhellblazer does this happen to many WebVR demos as well as other engines/frameworks? If so, it is Chrome 58 regression bug, and should be reported here: https://bugs.chromium.org/p/chromium/issues/list

Edit: here is bug report about that: https://bugs.chromium.org/p/chromium/issues/detail?id=724398 You can help by staring this issue there.

Dhellblazer commented 7 years ago

Hello everyone, as I mentioned earlier in Chrome 58 there is the problem that it does not load well the screen, because it comes reduced or only a part. With happiness I comment that the version 59 must leave the next week, at the moment you can download the Beta version, in this version (Chrome 59) the problem is solved. Thank you.