WebVR is an experimental JavaScript API that provides support for virtual reality devices, such as the HTC Vive, Oculus Rift or Google Cardboard, in a web browser.
Contents
This API is designed with the following goals in mind:
History
WebVR was first conceived in spring 2014 by Vladimir Vukićević from Mozilla. The API's contributors include Brandon Jones, Boris Smus and others from the Mozilla team. On March 1, 2016, the Mozilla VR team and the Google Chrome team announced the version 1.0 release of the WebVR API proposal. The resulting API refactoring brought many improvements to WebVR.
The last tagged version is 1.1, which was last edited on April 5, 2017. The editors of the document include members from Mozilla and Google teams. However some Microsoft members have joined, and are actively collaborating in the drafting process of version 2.0 for the WebVR API.
Design
The WebVR API exposes a few new interfaces (such as VR Display, VR pose) that allow web applications to present content in virtual reality, by using WebGL with the necessary camera settings and device interactions (such as controllers or point of view). The API has been designed to follow a certain path, which is very similar to other intrusive Web API like the Geolocation API. The necessary steps are:
- Request a list of the available VR devices.
- Checks to see if the desired device supports the presentation modes the application needs.
- If so, application advertises VR functionality to the user.
- User performs an action that indicates they want to enter VR mode.
- Request a VR session to present VR content with.
- Begin a render loop that produces graphical frames to be displayed on the VR device.
- Continue producing frames until the user indicates that they wish to exit VR mode.
- End the VR session.
Support
WebVR still relies on a special browser version with the API enabled in a special settings screen that most users would not be able to find easily. WebVR is currently supported in Firefox Nightly Build and custom build Chrome. WebVR v1.0 is in Android Chrome behind a flag. Until WebVR is actually supported most browsers still support part of the API through a polyfill. Microsoft announced in September 2016 that it had started development of WebVR in the Edge browser.
Currently (April 8, 2017), the WebVR API is still in early development. As such, the defined APIs are changing frequently and cannot be considered stable. While the API is being finalized, version 1.1 may be found in some browsers: Chrome for Android, Firefox Nightly, Samsung Internet, Microsoft Edge, Chromium, Servo and Oculus Carmel.
It should be noted, that support of WebVR doesn't imply that a certain browser supports a specific headset. But that it provides the necessary API, leaving to browsers to choose which headset to support.
Notable uses
Below are some notable companies or projects related to WebVR:
Similar technologies
Although WebVR is unique as an API, there are native applications on most hardware allowing for networked experiences and access to web content. Several key tools, such as Unity and Blender, are also able to export for the web and provide users a way to use their content without installing a dedicated application.