Top Banner
Migrating Web apps to Virtual Reality
70

Migrating your Web app to Virtual Reality

Jan 08, 2017

Download

Technology

Denis Radin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Migrating your Web app to Virtual Reality

Migrating Web appsto Virtual Reality

Page 2: Migrating your Web app to Virtual Reality

@PixelsCommander

[email protected]

Page 3: Migrating your Web app to Virtual Reality
Page 4: Migrating your Web app to Virtual Reality
Page 5: Migrating your Web app to Virtual Reality

????

Legal stuff, four characters

Page 6: Migrating your Web app to Virtual Reality

GLSL

Legal stuff, four characters

Page 7: Migrating your Web app to Virtual Reality

Already legal on the web

OpenGL Shading Language

Page 8: Migrating your Web app to Virtual Reality

500 000 lines of code JavaScript OSiPhone 2g, 512 RAM

Page 9: Migrating your Web app to Virtual Reality

ChallengingNative.comFast web applications development, profiling and optimization

Page 10: Migrating your Web app to Virtual Reality

CPU GPU

Page 12: Migrating your Web app to Virtual Reality

CPU GPU

Page 13: Migrating your Web app to Virtual Reality

Modern GPU can handle 100 000 000

of textured surfacesMay treat this as

“100 000 000 of animated HTML elements”

Page 14: Migrating your Web app to Virtual Reality

Let`s release bunnies!

OpenGL is also available on the Web

via WebGL

Page 15: Migrating your Web app to Virtual Reality

Why do not we use WebGL for content?Imperative, verbose, no layout

Page 16: Migrating your Web app to Virtual Reality

HTML

<img src=”back.png”>

WebGL: Bad parts

WebGL (three.js)var renderer = new THREE.WebGLRenderer();

renderer.setSize(window.innerWidth, window.innerHeight);

document.body.appendChild(renderer.domElement);

var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);

camera.position.z = 500;

var scene = new THREE.Scene();

var material = new THREE.MeshLambertMaterial({

map: THREE.ImageUtils.loadTexture('http://www.html5canvastutorials.com/demos/assets/crate.jpg')});

var plain = new THREE.Mesh(new THREE.Plain(200, 200), material);

scene.add(plain);

Page 17: Migrating your Web app to Virtual Reality
Page 18: Migrating your Web app to Virtual Reality

Renders HTML/CSS in WebGL

Page 19: Migrating your Web app to Virtual Reality

<img src=”back.png”>

HTML GL

<html-gl>

<img src=”back.png”>

</html-gl>

Page 22: Migrating your Web app to Virtual Reality

working in Entertainment department

This is not just about TVs

Page 23: Migrating your Web app to Virtual Reality

And VR porn is coming

Porn drives the world

Page 24: Migrating your Web app to Virtual Reality

Sorry, I mean:”We are concerned

about entertainment trends”

Page 25: Migrating your Web app to Virtual Reality

How VR works?

Page 26: Migrating your Web app to Virtual Reality
Page 27: Migrating your Web app to Virtual Reality
Page 28: Migrating your Web app to Virtual Reality
Page 29: Migrating your Web app to Virtual Reality

How VR on the Web could work?

Page 30: Migrating your Web app to Virtual Reality

- Would CSS 3D work for porting my Web

app to VR?

Page 32: Migrating your Web app to Virtual Reality

- No

- Would CSS 3D work for porting my Web

app to VR?

Page 33: Migrating your Web app to Virtual Reality

= delay

2 eyes, 2 instances

Page 34: Migrating your Web app to Virtual Reality

= solution, no lag

1 master, 2 slaves

Page 35: Migrating your Web app to Virtual Reality
Page 36: Migrating your Web app to Virtual Reality
Page 37: Migrating your Web app to Virtual Reality
Page 38: Migrating your Web app to Virtual Reality
Page 39: Migrating your Web app to Virtual Reality

We need GLSL to make FOV transformation and chromatic aberration correction

Sorry, no CSS3D, seriously

Page 40: Migrating your Web app to Virtual Reality

The approach to build Virtual Worlds for the web

What is WebVR?

Page 41: Migrating your Web app to Virtual Reality

Family of APIs: WebGL + VR Sensors + Gamepad API +

Helmet detection API

What is WebVR?

Page 42: Migrating your Web app to Virtual Reality

vrDisplay.requestAnimationFrame()

What is WebVR?

Page 43: Migrating your Web app to Virtual Reality

WebVR support

Page 44: Migrating your Web app to Virtual Reality

And WebVR is open

Oculus and Vive are proprietary

ecosystems

Page 45: Migrating your Web app to Virtual Reality

No need to download something

WebVR is instant

Page 46: Migrating your Web app to Virtual Reality

Companies bet on WebVR

Page 47: Migrating your Web app to Virtual Reality

ThreeVR, ThreeVREffect

Mostly done with Three.js

Page 48: Migrating your Web app to Virtual Reality

10 lines to turn Three.js app into WebVR experience

Page 49: Migrating your Web app to Virtual Reality

HTML

<img src=”back.png”>

WebGL: Bad parts

WebGL (three.js)var renderer = new THREE.WebGLRenderer();

renderer.setSize(window.innerWidth, window.innerHeight);

document.body.appendChild(renderer.domElement);

var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000);

camera.position.z = 500;

var scene = new THREE.Scene();

var material = new THREE.MeshLambertMaterial({

map: THREE.ImageUtils.loadTexture('http://www.html5canvastutorials.com/demos/assets/crate.jpg')});

var plain = new THREE.Mesh(new THREE.Plain(200, 200), material);

scene.add(plain);

Page 50: Migrating your Web app to Virtual Reality

HTML / CSS is way more efficient

Creating UIs in 3D is hardMaya Polivanova

Page 51: Migrating your Web app to Virtual Reality

Your site just works, “for free”. But the site is stuck inside a small window. Developers should be able to fill the entire 360 environment.

Page 52: Migrating your Web app to Virtual Reality

What if developers could, with CSS: apply a 360 background, make the window transparent, and re-position elements in 3D space?

Page 53: Migrating your Web app to Virtual Reality

Basic concept prototype, made with A-Frame. 3D repositioning not used in this one.

Page 54: Migrating your Web app to Virtual Reality

Concept prototype, made with A-Frame. 3D repositioning not used in this one.

Page 55: Migrating your Web app to Virtual Reality
Page 56: Migrating your Web app to Virtual Reality

Can

- Sorry it is 2D only so far

- Can you drop web app into a 3D space

with HTML-GL?

Page 57: Migrating your Web app to Virtual Reality
Page 58: Migrating your Web app to Virtual Reality
Page 59: Migrating your Web app to Virtual Reality

A year later...

Page 60: Migrating your Web app to Virtual Reality
Page 61: Migrating your Web app to Virtual Reality

HTML-GL v2 is more performant

Page 62: Migrating your Web app to Virtual Reality

HTML-GL v2 better sync with DOM

Page 63: Migrating your Web app to Virtual Reality

Renderers, rasterizers

HTML-GL v2 is pluggable

Page 64: Migrating your Web app to Virtual Reality

Three.js means WebVR

HTML-GL v2 three.js plugin

Page 65: Migrating your Web app to Virtual Reality

How it works?

Page 66: Migrating your Web app to Virtual Reality

The flow

Page 67: Migrating your Web app to Virtual Reality

DEMO TIME

Page 68: Migrating your Web app to Virtual Reality

What is this?

ReactVR by Oculus/Facebook

Page 69: Migrating your Web app to Virtual Reality

21st of April

React Amsterdam

Page 70: Migrating your Web app to Virtual Reality

Questions?

github.com/PixelsCommander/HTML-GL

@PixelsCommander