There’s a lot happening in the world of WebVR at the moment. Today’s big news is that Chrome 56 has now been released for Android, bringing WebVR support to Daydream phones (other devices to follow). This is an important landmark on the journey towards ubiquitous WebVR-capable devices. At some point we’ll be getting a desktop version of Chrome that has WebVR, too: for now I’m still testing with Chromium, as suggested by the WebVR download instructions.
The other noteworthy event – at least from Autodesk’s perspective – is the release of v2.13 of the Forge viewer. This brings some VR-related functionality I’ve been waiting for impatiently for the last few years. I’ve been chomping at the bit to get not only VR support in the Forge viewer – which happened with v.2.12 – but to get a turntable navigation mode, where your head movements map to the rotation of the model you’re examining. This is as opposed to a first person, or “look around” navigation style. Some people use the terms exocentric vs. egocentric for this distinction.
Anyway, I’ve needed this mode of navigation for Vrok-It, which – up until now – has made use of two independent (but connected by code) instances of the Forge viewer, managing their respective cameras based on the tilting of the device. Which is fine (or tolerable, anyway) for Google Cardboard, but didn’t bring the capability to other WebVR-capable devices (such as a PC running tethered VR such as Oculus Rift or HTC Vive). The new version opens that door, which is really cool.
To enable this mode in the new viewer, you need to set the experimental flag when you initialize it:
var config = {
extensions: ['Autodesk.Viewing.WebVR'],
experimental: ['webVR_orbitModel']
}
var viewer = new Autodesk.Viewing.Viewer3D(container, config);
An alternative is to pass the flag when you load the extension manually in your code:
viewer.loadExtension('Autodesk.Viewing.WebVR', { experimental: ['webVR_orbitModel'] });
The latest version of Vrok-It – which I’ve kept separate until the Forge viewer turntable navigation is no longer considered experimental – uses this new capability to pretty good effect. Here’s a video – recorded on my Nexus 5X phone – showing it in action:
You can try it yourself even if you have an older version of Chrome (or another browser) on Android/iOS: the Forge viewer will automatically load the polyfill to support browsers that aren’t yet WebVR-native.
On a related note, I’m really encouraged to see the amount of attention being paid to mobile support – whether for VR or otherwise – by the Forge viewer team. For instance, you can also enable “model consolidation” – from v2.12 – by using these flags (the latter of which is optional):
var initializerOptions = {
env: 'AutodeskProduction',
useConsolidation: true,
consolidationMemoryLimit: 150 * 1024 * 1024 // 150MB - Optional, defaults to 100MB
}
Autodesk.Viewing.Initializer(initializerOptions, function () {
// ...
});
This flag optimizes the loaded model for faster rendering using mesh consolidation and hardware instancing. It does require more memory – and can’t be used with optimizations such as progressive rendering – but should give significant performance benefits.
I’ve integrated the flag into the Vrok-It code – which is completely public and available on GitHub – in case you want to see how it works.
It’s great to see things moving ahead with WebVR. I continue to be really enthusiastic about its ability to bring VR – and, particularly, content created using Autodesk tools and shared through Forge – to anyone with a smartphone.