What is Web VR?
This API is designed with the following goals in mind:
- Detect available virtual reality devices.
- Query the device’s capabilities.
- Poll the device’s position and orientation.
- Display imagery on the device at the appropriate frame rate.
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.
- Check 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.