Anúncio

Портируем существующее Web-приложение в виртуальную реальность / Денис Радин (Liberty Global)

Ontico
Ontico
26 de Jun de 2017
Anúncio

Mais conteúdo relacionado

Similar a Портируем существующее Web-приложение в виртуальную реальность / Денис Радин (Liberty Global)(20)

Anúncio

Mais de Ontico(20)

Anúncio

Портируем существующее Web-приложение в виртуальную реальность / Денис Радин (Liberty Global)

  1. Migrating Web apps to Virtual Reality
  2. @PixelsCommander denis.radin@gmail.com
  3. TV STB Operating system, 500 000 lines of JavaScript
  4. working in Entertainment department This is not just about TVs
  5. And VR porn is coming Porn drives the world
  6. Sorry, I mean: ”We are concerned about entertainment trends”
  7. Why drop web apps to VR?
  8. Example You made a car customization web app
  9. Concept prototype, made with A-Frame. 3D repositioning not used in this one.
  10. Example You made a real estate catalog as a web app
  11. Basic concept prototype, made with A-Frame. 3D repositioning not used in this one.
  12. Nice to know about real estate 3d revolution:
  13. So… Virtual Reality provides new experiences for customers
  14. Not just a flat picture
  15. 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.
  16. What if developers could, with CSS: apply a 360 background, make the window transparent, and re-position elements in 3D space?
  17. How VR works?
  18. VR DEV: Good parts
  19. UNITY GameObject canvasGO = new GameObject(); RectTransform canvasRT = canvasGO.AddComponent<RectTransform>(); Canvas canvasCV = canvasGO.AddComponent<Canvas>(); canvasCV.RenderMode = RenderMode.ScreenSpaceCamera; Vector3 pos = Camera.main.transform.position; pos += Camera.main.transform.forward * 10.0f; canvasCV.worldCamera = Camera.main; GameObject buttonGO = new GameObject(); RectTransform buttonRT = buttonGO.AddComponent<RectTransform>(); buttonRT.SetParent(canvasRT); buttonRT.sizeDelta = new Vector2(200.0f, 100.0f); Button buttonBU = buttonGO.AddComponent<Button>(); buttonBU.onClick.AddListener( () => { VR DEV: Bad parts Three.js var gui = new THREE.SimpleDatGui(); gui.add(myFunctions, 'RESET_EVENT').name('Reset Position'); gui.add(gui_options, 'CONNECT_TO_OCULUS_RIFT').name('Oculus Control').onChange(function(value) { oculusRiftControl.setActive(value); }); gui.add(gui_options, 'TRANPARENT').name('Tranparent').onChange(function( value) { gui_options.OPACITY = (value) ? 80 : 100; }); gui.add(gui_options, 'OPACITY', 10, 100).step(10).name('Opacity').onChange(function(val ue) { gui_options.TRANPARENT = !(value == 100);
  20. Step backward for front-end ninjas
  21. Bah, we would do this with HTML/CSS easily!
  22. How?
  23. - Would CSS 3D work for porting my Web app to VR?
  24. Kinda we can display HTML content in VR for free Demo, Demo2
  25. 2 eyes, 2 iframes
  26. - No - Would CSS 3D work for porting my Web app to VR?
  27. Problem 1: Delay between iframes producing sickness
  28. = delay 2 eyes, 2 instances
  29. = solution, no lag 1 master, 2 slaves
  30. Problem 2: Field of view distortion
  31. Field of view enhancement
  32. Problem 3: Chromatic aberration
  33. Making it distanced
  34. We need shaders to apply FOV transformation and chromatic aberration Sorry, no CSS3D, seriously
  35. The approach to build Virtual Worlds for browser What is WebVR?
  36. Family of APIs: WebGL + VR Sensors + Gamepad API + Helmet detection API What is WebVR?
  37. vrDisplay.position() vrDisplay.acceleration() vrDisplay.requestAnimationFrame() What is WebVR?
  38. And WebVR is open Oculus and Vive are proprietary ecosystems
  39. WebVR support
  40. No need to download something WebVR is instant
  41. Companies bet on WebVR
  42. ThreeVR, ThreeVREffect plugins WebVR mostly uses Three.js
  43. HTML <img src=”back.png”> WebVR: Bad parts WebVR (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.html5canva stutorials.com/demos/assets/crate.jpg')}); var plain = new THREE.Mesh(new THREE.Plain(200, 200), material); scene.add(plain);
  44. Wait a minute...
  45. 500 000 lines of code JavaScript OS iPhone 2g, 512 RAM
  46. ChallengingNative.com Fast web applications development, profiling and optimization
  47. CPU GPU
  48. CPU GPU
  49. Modern GPU can handle 100 000 000 of textured surfaces May treat this as “100 000 000 of animated HTML elements”
  50. Why so many? For some 3d things it is still not enough of details
  51. Let`s release bunnies! OpenGL is also available on the Web via WebGL
  52. Why do not we use WebGL for content? Imperative, verbose, no layout
  53. 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.html5canva stutorials.com/demos/assets/crate.jpg')}); var plain = new THREE.Mesh(new THREE.Plain(200, 200), material); scene.add(plain);
  54. Renders HTML/CSS in WebGL
  55. <img src=”back.png”> HTML GL <html-gl> <img src=”back.png”> </html-gl>
  56. No! Does this improves performance only?
  57. Demo Some goodies for PhoneGap
  58. Ring… Ring...
  59. Can - Sorry it is 2D only so far - Can you drop web app into a 3D space with HTML-GL?
  60. A year later...
  61. v2 Renders HTML/CSS in WebGL and WebVR Should we call it HTML2VR?
  62. HTML-GL v2 is x10 more performant
  63. HTML-GL v2 better sync with DOM
  64. Renderers, rasterizers HTML-GL v2 is pluggable
  65. Three.js means WebVR HTML-GL v2 three.js plugin
  66. Not only porting existing apps...
  67. HTML / CSS is way more efficient Creating UIs in 3D is expensive
  68. Creating UIs for VR quickly
  69. UNITY GameObject canvasGO = new GameObject(); RectTransform canvasRT = canvasGO.AddComponent<RectTransform>(); Canvas canvasCV = canvasGO.AddComponent<Canvas>(); canvasCV.RenderMode = RenderMode.ScreenSpaceCamera; Vector3 pos = Camera.main.transform.position; pos += Camera.main.transform.forward * 10.0f; canvasCV.worldCamera = Camera.main; GameObject buttonGO = new GameObject(); RectTransform buttonRT = buttonGO.AddComponent<RectTransform>(); buttonRT.SetParent(canvasRT); buttonRT.sizeDelta = new Vector2(200.0f, 100.0f); Button buttonBU = buttonGO.AddComponent<Button>(); buttonBU.onClick.AddListener( () => { VR DEV: Bad parts Three.js var gui = new THREE.SimpleDatGui(); gui.add(myFunctions, 'RESET_EVENT').name('Reset Position'); gui.add(gui_options, 'CONNECT_TO_OCULUS_RIFT').name('Oculus Control').onChange(function(value) { oculusRiftControl.setActive(value); }); gui.add(gui_options, 'TRANPARENT').name('Tranparent').onChange(function( value) { gui_options.OPACITY = (value) ? 80 : 100; }); gui.add(gui_options, 'OPACITY', 10, 100).step(10).name('Opacity').onChange(function(val ue) { gui_options.TRANPARENT = !(value == 100);
  70. Demo time
  71. How it works?
  72. The flow
  73. Roadmap
  74. WebVR as a progressive enchancement? vr.yourdomain.com
  75. WebVR as a progressive enchancement? WordPress WebVR plugin
  76. <a-html> A-Frame plugin
  77. Text rendering optimizations with SDF
  78. What is this? ReactVR by Oculus/Facebook
  79. Questions? github.com/PixelsCommander/HTML-GL @PixelsCommander
  80. Thank you! Bye!
Anúncio