Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HoloJS at a Glance

HoloJS at a Glance

Microsoft HoloLens, introduced in 2015, is the world’s first untethered holographic computer. Apps are written in DirectX/C++ or with the help of Unity. Almost two years later, Microsoft released HoloJS, a framework for creating holographic applications in JavaScript and WebGL. Let’s have a quick look at HoloJS: is it ready for production?

Christian Liebel

September 07, 2017
Tweet

More Decks by Christian Liebel

Other Decks in Programming

Transcript

  1. What to Expect? KarlsruheJS HoloJS at a Glance I tried

    HoloJS for evaluation purposes Migration of a small existing THREE.js sample “Cross-platform in a new dimension” Does it work? Is it ready for production?
  2. Reality–Virtuality Continuum (Milgram et al. 1994) Reality Virtuality Augmented Reality

    Augmented Virtuality.. HoloLens HTC Vive Mixed Reality ARKit KarlsruheJS HoloJS at a Glance
  3. Application Model Universal Windows Platform Windows 10 Windows 10 Windows

    10 Mobile Xbox One HoloLens Windows 10 UWP App KarlsruheJS HoloJS at a Glance
  4. HoloJS KarlsruheJS HoloJS at a Glance Runs WebGL content as

    an immersive app Transpiles WebGL to DirectX via ANGLE Contains Microsoft’s JS engine ChakraCore Supports native WebGL and THREE.js Updates the camera position (head tracking) Open-source: liebel.io/holojs
  5. WebGL Web Graphics Library KarlsruheJS HoloJS at a Glance Canvas

    Context Hardware-accelerated 3D graphics Based on OpenGL for Embedded Systems WebGL 1.0 = OpenGL ES 2.0 (86.7%*) WebGL 2.0 = OpenGL ES 3.0 (55.3%*) * Browser support data for Germany as of September 6, 2017 https://caniuse.com/#search=webgl
  6. ANGLE Almost Native Graphics Layer Engine KarlsruheJS HoloJS at a

    Glance HoloLens is a DirectX device OpenGL calls have to be transpiled Open-source project by Google Used by Chrome and Firefox on Windows
  7. THREE.js KarlsruheJS HoloJS at a Glance Native WebGL is complex

    Open-source JavaScript library High-level API abstracting WebGL Concepts: Scene, Camera, Geography, Material
  8. HoloJS KarlsruheJS HoloJS at a Glance Provides artificial Canvas3D element

    Provides viewMatrix on window object (inside-out head tracking) Keeps holograms stable in the environment Provided as HolographicCamera for THREE.js
  9. KarlsruheJS HoloJS at a Glance container = document.getElementsByTagName('canvas')[0]; camera =

    new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 1, 500); camera.position.set(0, 0, 30); scene = new THREE.Scene(); // Sphere var textureLoader = new THREE.TextureLoader(); textureLoader.load('assets/earth.jpg', function (texture) { var geometry = new THREE.SphereGeometry(5, 32, 32); var material = new THREE.MeshLambertMaterial({map: texture}); var sphere = new THREE.Mesh(geometry, material); sphere.rotation.y = 250 * Math.PI / 180; scene.add(sphere); }); // Stars var starsCount = 2500;
  10. Drawbacks KarlsruheJS HoloJS at a Glance Bundles the entire ANGLE/Chakra

    libraries Troublesome debugging (console.log) Device deployment takes a long time Incompatible to some THREE.js features Mixed Reality Capture is buggy Unstable (AddressViolationException) Lacks a lot of features known from Unity
  11. Summary KarlsruheJS HoloJS at a Glance HoloJS is a cool

    (side) project Runs (suitable) existing THREE.js apps Cross-platform on the next level Microsoft’s recommendation: Unity Light years away from Unity’s feature set and development comfort