WebVR:

Virtual Reality

for the Web

Meet.js Warsaw

Andrzej Mazur@end3rEnclave Games
Meet.js Warsaw — Warsaw, Poland — September 30th 2015

Andrzej Mazur

Andrzej Mazur

end3r.com, enclavegames.com, js13kgames.com, gamedevjs.com, gamedevjsweekly.com, devicelab.pl

History of VR

View Master

View Master (1939)

History of VR

Project Headsight

Project Headsight (1961)

VR in pop culture

Star Trek - Holodeck

Tron (1982), Star Trek (1987), Matrix (1999)

VR gaming history

Sega VR

Sega Genesis (1991)

VR gaming history

Virtua racing

Virtua Racing (1993)

Today

Military use of Oculus

Norvegian Army (2014)

Devices

VR Devices

Desktop

Oculus Rift

Oculus Rift

Console

Project Morpheus

Playstation VR (Project Morpheus)

Mobile

HTC Vive

Gear VR, HTC Vive, Google Cardboard

Browser support

MozVR

Firefox Nightly, Chromium

Documentation status

Editors Draft: mozvr.github.io/webvr-spec/webvr.html

 

  • Vladimir Vukicevic (Mozilla)
  • Brandon Jones (Google)

 

Web: mozvr.com, webvr.info.

Web vs Native (again)

Install vs online, multiplatform, distribution through URLs

Input

Oculus Touch

Keyboard and mouse, Leap Motion, Gamepad API, Device Orientation, ...

VR API

HMDVRDevice and PositionSensorVRDevice

developer.mozilla.org/en-US/docs/Web/API/WebVR_API

Head Mounted Display

Headset

HMDVRDevice: getEyeParameters(), setFieldOfView().

Positional Tracker

Positional Tracker

PositionSensorVRDevice: getState(), resetSensor().

Get the devices

navigator.getVRDevices().then(function(devices) {
  for (var i = 0; i < devices.length; ++i) {
    if (devices[i] instanceof HMDVRDevice) {
      gHMD = devices[i];
      break;
    }
  }
  if (gHMD) {
    for (var i = 0; i < devices.length; ++i) {
      if (devices[i] instanceof PositionSensorVRDevice
      	 && devices[i].hardwareUnitId === gHMD.hardwareUnitId) {
        gPositionSensor = devices[i];
        break;
      }
    }
  }
});

WebGL + Three.js

VREffect ⁄ VRControls

var effect = new THREE.VREffect(renderer);
var manager = new WebVRManager(renderer, effect);

Stereoscopic rendering in WebVR

hacks.mozilla.org/2015/09/stereoscopic-rendering-in-webvr/

function init () {
  // using gl-matrix for linear algebra
  var viewMatrix = mat4.lookAt(mat4.create(), eye, center, up);
  var projectionMatrix = mat4.perspective(mat4.create(), fov, near, far);
  var mvpMatrix = mat4.multiply(mat4.create(), projectionMatrix, viewMatrix);
  gl.uniformMatrix4fv(uniforms.uMVPMatrixLocation, false, mvpMatrix);
};
function update (t) {
  gl.clear(flags);
  gl.drawElements(mode, count, type, offset);
  requestAnimationFrame(update);
};

Not only for games

3D websites, CSS for VR

Tools and techniques

Kickstart your project.

Responsive WebVR

smus.com/responsive-vr/

Sechelt

Write once, run in any VR headset... or without it.

WebVR Boilerplate

github.com/borismus/webvr-boilerplate

VR Boilerplate

A starting point for web-based VR experiences.

Unity and Unreal

Dead Trigger 2

Both export to WebGL using asm.js.

It's happening

Consumer devices: Q1 2016.

There's already an API for that!

The future

W3C specification

Stable specification

The future

Minority Report

Totally new UX and UI

The future

Gif

Better hardware

The future

Tools

More tools and libraries

Lessons learned

Motion sickness may be a problem

Motion sickness

(keep high framerate, no camera movement, keep horizon level)

Lessons learned

New 360 view

Polar Sea

(give reasons to look around)

Lessons learned

Immersion over gameplay and⁄or graphics

Rainbow Membrane

(you have to be "inside")

Technical challenges

Demo booth

BrazilJS

Demo laptop

WebVR Station

Wow-effect

Aliens

Device Lab

Device Lab

devicelab.pl

Go and build the future of the Web!

MozVR.com

Thanks! Questions?

 

 

end3r.com/slides/meetjswarsaw-webvr

 

 

Andrzej Mazur@end3rEnclave Games

Ender Efka @end3r