30
WebGL and WebVR The next frontier

The next frontier: WebGL and WebVR

Embed Size (px)

Citation preview

Page 1: The next frontier: WebGL and WebVR

WebGL and WebVRThe next frontier

Page 2: The next frontier: WebGL and WebVR

Hi, I’m Martin from Zurich

I work at Archilogic

Page 3: The next frontier: WebGL and WebVR

What we’ll do today1. WebGL 101 / Three.js intro2. WebVR introduction3. Wrap up / Questions

Page 4: The next frontier: WebGL and WebVR

WebGL 101

Page 5: The next frontier: WebGL and WebVR

Use cases● Maps / Navigation● Art / Architecture / History● Medicine● Entertainment / Games● Image processing / CAD

Page 6: The next frontier: WebGL and WebVR

Browser support

Page 7: The next frontier: WebGL and WebVR

From 2D to 3D

Page 8: The next frontier: WebGL and WebVR

Vocabulary I / V

Vertices

Page 9: The next frontier: WebGL and WebVR

Vocabulary II / V

Face

Face

Page 10: The next frontier: WebGL and WebVR

Vocabulary III / V

Texture

Page 11: The next frontier: WebGL and WebVR

Vocabulary IV / V

Rasterization Normal vector

Fragment

Page 12: The next frontier: WebGL and WebVR

Vocabulary V / V● Shaders = GPU programs● Written in GLSL● Vertex shader:(vertex) => (new vertex)

● Fragment shader:(position, ..) => (color, depth)

Page 13: The next frontier: WebGL and WebVR

WebGL pipeline

Page 15: The next frontier: WebGL and WebVR

WebVR

Page 16: The next frontier: WebGL and WebVR

Specification (work in progress)

https://mozvr.github.io/webvr-spec/

Page 17: The next frontier: WebGL and WebVR

Start exploring!

Page 18: The next frontier: WebGL and WebVR

WebVR with Three.jsvar vrEffect = new THREE.VREffect(renderer),

vrControls = new THREE.VRControls()

vrControls.update()

vrEffect.render(scene, camera)

Page 19: The next frontier: WebGL and WebVR

Photo Spheres

Page 20: The next frontier: WebGL and WebVR

Photo Spheres

Page 21: The next frontier: WebGL and WebVR

A-Frame <body>

<a-scene>

<a-cube></a-cube>

</a-scene>

</body>

Page 22: The next frontier: WebGL and WebVR

Augmented reality

Page 23: The next frontier: WebGL and WebVR

getUserMedia + WebGL

Page 24: The next frontier: WebGL and WebVR

Google Tango + WebVR

Page 25: The next frontier: WebGL and WebVR

Code behind the demo I / IInavigator.getVRDevices().then(

(devices) => {

devices[0].resetSensor()

startRenderLoop(devices[0])

})

Page 26: The next frontier: WebGL and WebVR

Code behind the demo II / IIvar state = device.getState()

cam.quaternion.copy(state.orientation)

cam.position.set(

state.position.x,

state.position.y,

state.position.z)

Page 28: The next frontier: WebGL and WebVR

Final remarks

“ ... the computer is [...] a bicycle for our minds”

Page 29: The next frontier: WebGL and WebVR

Final remarks

“ ... virtual reality is [...] a teleporter for our minds”

Page 30: The next frontier: WebGL and WebVR

Grazie!Slides: bit.ly/cm16-rome-3d

Twitter: @g33konaut

Web: archilogic.com

Questions?