WebVR:

Virtual Reality

for Web Games

Game Industry Conference 2015

Andrzej Mazur@end3rEnclave Games
Game Industry Conference — PoznaƄ, Poland — October 17th 2015

HTML5 Game Developer

Andrzej Mazur

Enclave Games

Enclave Games

Caveman Grru

Caveman Grru

Wizard Quest

Wizard Quest

'Wow' effect

Wow-effect of Oculus

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

Gear VR

Gear VR, 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);
};

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 (90 fps x2)

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, show... nose?

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

Gamedev.js Weekly

Gamedev.js Weekly

gamedevjsweekly.com

js13kGames

js13kGames

js13kgames.com

MozVR.com

Go and build the future of the Web!

Find out how millions of people will use it.

Thanks! Questions?

 

 

end3r.com/slides/gic15-webvr

 

 

Andrzej Mazur@end3rEnclave Games

Ender Efka @end3r