Introducing
WebVR
And the Virtual Reality Web
Peter O'Shaughnessy | @poshaughnessy
Imagine the possibilities...
VR web apps possible now
8 million web devs rejoice!
New Web API!
Browsers implementing:
- Device discovery
- Full screen extensions
- Sensor integration, e.g. orientation
- Rendering for different hardware
“WebVR”
- "Version Zero"
- Not even in alpha channels yet
Step 1: Develop WebGL app as usual
Step 2: Add WebVR goodness
Get available VR devices
if( navigator.getVRDevices ) {
navigator.getVRDevices().then( ... );
}
(This is the only code I'll show - promise!)
Render scene twice, once for each eye
Oculus Rift
WebVR provides recommended eye FOV & translation
Request full screen on the VR device
Oculus Rift
The browser will handle the distortion!
Step 3: Ensure you have included at least one dinosaur
Oculus Rift Web TRex!
Thanks to DK and
eyeon Software for lending me the content.
Google Cardboard
Google Cardboard
- No WebVR support yet
- But we can use HTML5 Orientation API
- Three.js provides DeviceOrientationControls
- ...and StereoEffect
- Just the distortion, then.
Cardboard TRex! (Minus Cardboard)
Thanks again to DK for lending the dinosaur.
Code examples from Google
Bonus!
Come say hi to the T-rex!