With Construct Arcade my co-founder Florian and I are as close to working with the WebXR API as it gets. To give you some hints on what to look out for with recent browser support, here is an updated version of How to WebXR in July 2018.
Most of the hints in that blog post still apply, so make sure to also read that.
There are the many versions and APIs for VR on the flying around. I tried to assemble a table. It is likely incomplete, and support from many browsers is missing
Firefox 55+ for Windows 11
Firefox 64+ for Mac 12
Chrome 56-62 (+?) 15
Microsoft Edge build 15002+ 16
|WebXR Device API||First Draft||?||Chrome 66+ 17|
|Second Draft||?||Chrome 73+|
It turns out that latest Chrome has some updates to their WebXR implementation that make it follow the latest changes on the WebXR spec. Things like supportsSessionMode are implemented in Chrome 73.
On the one hand this is great news! On the other this breaks all WebXR based applications and games that have been developed with the older versions of the spec that was implemented and available through the origin trials up to and including Chrome 72.
Even frameworks like A-Frame are not quite able to shield you from these breaks.
For Construct Arcade I will be implementing a backwards compatibility shim/polyfill library that will allow running older WebVR games without updating them manually.
While updating three.js or A-Frame—if you built your game with one of those frameworks— would usually also update the use of browser VR API, that is often not easy because of deprecation and removal of other unrelated features.
(Any future information about this will be added here)
Upcoming WebGL extensions like
WebGL_multi_draw 18 and
OVR_multiview2 19 appear to
be the solution to performance with many draw calls. Until these are widespread enough and
implemented in all browsers, we still have to worry about this topic ourselves, though.
With WebXR you target a range of devices from clients on smartphones, standalone VR and desktop. Keep your draw call counts low, meshes and textures small and avoid complex PBR shaders and shadow passes if possible.
If you want to preserve as much visual fidelity as possible, have auto-scaling settings for mobile devices. That can range from using different meshes to disabling rendering features.
With smooth performance, VR is fun immersive! On 5 fps very much not.
The open source VR browser Exokit 20 has been very active lately. In case you want to develop a VR app to submit to Google Play or Oculus Platform, you should be able to build on top of Exokit. I plan on trying this and will report back once I know more.
Additionally Exokit is working on Atmos, an XR headset for the web that is likely worth a follow.
- Spec is nowhere to be found online. I extracted it from the history of the WebXR GitHub repository for you to download it here as pdf.
- https://developers.google.com/web/fundamentals/vr/status/ or https://www.chromestatus.com/features/5680169905815552
- webmr.io and exokit.org