MozillaReality / unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
https://mixedreality.mozilla.org/unity-webxr-export/Build/
Apache License 2.0
624 stars 127 forks source link

requestAnimationFrame recursion on mobile #127

Closed itsthisjustin closed 6 years ago

itsthisjustin commented 6 years ago

As seen here: https://github.com/mozilla/unity-webvr-export/issues/54#issuecomment-363622646

I'm getting the same issue. Even the sample projects present this problem on all mobile browsers. I see on Firefox, Chrome (with flags for webvr set) and oddly enough on the Firefox nightly on Android tapping the headset icon just makes the experience full screen.

cvan commented 6 years ago

Thanks for digging this up from the comment and filing an issue. I'm going to take a look at this.

cvan commented 6 years ago

@itsthisjustin @caseyyee @delapuente: can you try checking out my branch in PR #132, and see it fixes things for you?

what are your steps to reproduce? just load https://mozilla.github.io/unity-webvr-export/ on one of your devices?

correct me if I'm missing something.

cvan commented 6 years ago

Original source was commented in https://github.com/mozilla/unity-webvr-export/issues/54#issuecomment-363622646:

image

itsthisjustin commented 6 years ago
5wvlu_ofecnvwmyj7mmebmzc91yylplg-xxrvdyjejhxixumm

On Firefox Stable the error still shows up in the console, however on both Chrome and Canary on Android, the experience doesn't crash anymore. It also now shows me the "VR Ready" icon which didn't previously show up.

caseyyee commented 6 years ago

@itsthisjustin this is definetly an issue we need to fix (raf errors), but just as a note, mobile is unreliable at best and not officially supported. Mobile browsers and devices generally don't have the memory and power to run these experiences well unfortunately!

itsthisjustin commented 6 years ago

@caseyyee yeah I guess that's going to depend largely upon how WebGL and WebVR are "handled" moving forward. The main page of webvr touts Cardboard as it's baseline way to experience the technology.

So if this Unity asset doesn't officially support mobile, it might not be good to say it's an export to webVR then since WebVR officially DOES support mobile.

itsthisjustin commented 6 years ago

Update: iPhone X with Safari gives the Maximum Call Stack error skype_picture 1

caseyyee commented 6 years ago

@itsthisjustin It's not actually a limitation of WebGL or WebVR. Mobile devices unfortunately simply don't have the power or memory to run Unityplayer well.

cvan commented 6 years ago

@caseyyee how should we go about updating the webvr-polyfill to include this patch (or the changes within this patch)? https://github.com/immersive-web/cardboard-vr-display/commit/6f6a0c1e8b28eb4a3c861aeab4f814e93207fb85

we don't want to upgrade the webvr-polyfill (#113) because of the changes required (#125).

and the webvr-polyfill.min.js is obviously minified. (this is going to get gross, heh, brb…)

caseyyee commented 6 years ago

@cvan probably just need to wait till we get fps controls in first. I don't think we can do much otherwise we lose fallback controls. Makes sense to prioritize #125 so we can get this polyfill updated sooner rather than later.

cvan commented 6 years ago

@caseyyee see the PR I opened yesterday: https://github.com/mozilla/unity-webvr-export/pull/175/files

cvan commented 6 years ago

this is fixed by PR #175. @itsthisjustin: could you please try the version on master and let us know if it resolves your issue? thank you!