How to enable WebVR on Google Chrome?

2020-07-13 09:29发布

问题:

I am trying to create a WebVR scene. For this task, I want to enable WebVR on Google Chrome. My OS is Windows 8.

I open flags using chrome://flags/. WebVR is not there. How can I enable it?

回答1:

Official channels of Google Chrome do not support WebVR. (now they do, see below)

There is an unofficial build of chrome that does. FYI Firefox Nightly also supports WebVR in their official and current release, as does Samsung Internet Beta for GearVR (the latter after some configuration).

UPDATE: Chrome Android now works with WebVR if you enable chrome://flags/#enable-webvr. See this manual on how to enable WebVR on different browsers.



回答2:

You can install Google Chrome extension for WebVR debugging It can really help to debug your VR application. You will be able change the position of the virtual device in the environment, to see the change of camera position. Also, it is possible to emulate the HTC Vive controllers.

Alternative is to use WebVR polyfill It adds WebVR-API to your browser.



回答3:

Currently you can test your sample webVR code on the following browsers :

Google Chromium
Firefox Nightly
Samsung browser for webVR

Google Chrome version 54.0 onwards was expected to support webVR, but it seems we have to wait a little more.

If you are not very comfortable with ThreeJS library for VR projects, you should try aframe framework ( check http://aframe.io ). Here you will focus only on the VR code flow and all other graphics related overheads (camera, rendering etc) will be taken care by aframe itself.



回答4:

Do you still need this special Chromium build? In latest Chrome #58 it seems the feature is available within chrome://flags now

WebVR Mac, Windows, Linux, Chrome OS, Android Enabling this option
allows web applications to access experimental Virtual Reality APIs.
#enable-webvr

Didnt try it out yet though (dont want to break my productive browser)

Greetz