React-360: WebVR Polyfill Implementation?

Created on 16 Dec 2016  Â·  4Comments  Â·  Source: facebookarchive/react-360

Description

The Default VR mode is only support with Oculus Rift & Gear VR,

Is it possible to use webvr-polyfill in react-vr like this example?

http://googlevr.github.io/webvr-polyfill/examples/basic/

or maybe there's another way to support mobile Web Browser VR mode?

thanks.

Most helpful comment

React VR defers all VR rendering to our OVRUI library. If you inject the polyfill into the page early enough, I'd imagine that OVRUI should detect it as though it is the actual API.

However, I don't have a lot of information on how the polyfill is implemented. I'd imagine that you'd need to force the canvas to be fullscreen and hide the remaining screen items – something we don't need to worry about with real WebVR implementations.

I'll be up front with you: we're not too concerned with getting this to work right now. Samsung phones can do true VR rendering using the Carmel browser today, and other Android phones will have full support for the WebVR APIs within the next couple months. I'd encourage you to pursue this, though, and please let us know if you get it working.

All 4 comments

@stu60610 I did get it working with Chrome Beta and my Vive also.

I would imagine you could do that because react runs as a layer above three.js and I would assume you can change the three.js render part to use the polyfill like other examples online.

@stu60610 @Fasani I gave this a go. It almost works without any setup. I npm installed it and then just imported it in my client.js

It did get my cardboard to work with the View in VR button, but I find that the landscape fullscreen height/width of the renderer have some issues. It tends to render itself too small on my actual phone. It doesn't want to center itself and go full height and width on its own.

It seems like the wrapper is getting the right height and width, but for some odd reason the canvas is showing up too small.

img_8097

The cardboard prompt seems to work, but maybe the prompt itself is what's breaking the other styles. Using Chrome's dev tools to simulate in the fake iPhone works perfectly though... hm...

React VR defers all VR rendering to our OVRUI library. If you inject the polyfill into the page early enough, I'd imagine that OVRUI should detect it as though it is the actual API.

However, I don't have a lot of information on how the polyfill is implemented. I'd imagine that you'd need to force the canvas to be fullscreen and hide the remaining screen items – something we don't need to worry about with real WebVR implementations.

I'll be up front with you: we're not too concerned with getting this to work right now. Samsung phones can do true VR rendering using the Carmel browser today, and other Android phones will have full support for the WebVR APIs within the next couple months. I'd encourage you to pursue this, though, and please let us know if you get it working.

Was this page helpful?
0 / 5 - 0 ratings