@dougsillars
Augmented Reality on the Web:
Building an ARt Gallery
Doug Sillars
March 19, 2019
Stockholm
@dougsillars
Contact Me:
@DougSillars
Doug.Sillars@gmail.com
www.dougsillars.com
Doug Sillars
Freelance Developer Relations
Performance Audits: Web/Native
Workshops:
Performance/Images/Video/AR
http://bit.ly/HighPerformanceAndroidApps
Virtual Reality
Virtual Reality
https://www.flickr.com/photos/68158920@N08/17742136272
Virtual Reality
Virtual Reality
Augmented Reality
Augmented Reality
Augmented Reality
• Wearing fancy occulus with cameras
• Really $$$
Augmented Reality –
Smartphone
https://www.flickr.com/photos/bellemarematt/28124392062
https://www.flickr.com/photos/bagogames/28628142444
Augmented Reality –
Smartphone
https://www.flickr.com/photos/bellemarematt/28124392062
https://www.flickr.com/photos/bagogames/28628142444
AR/VR- in the Browser
• What we can do today
• What is coming tomorrow
AR/VR- in the browser
• What we can do today
• A-Frame
• https://aframe.io
VR with A-Frame
https://dougsillars.github.io/ARtGallery/aframeHW.html
VR with A-Frame
https://dougsillars.github.io/ARtGallery/aframeHW.html
VR with A-Frame
https://dougsillars.github.io/ARtGallery/aframeHW.html
VR with A-Frame
https://dougsillars.github.io/ARtGallery/aframeHW.html
VR with A-Frame
https://dougsillars.github.io/ARtGallery/aframeHW.html
Building a Gallery
https://dougsillars.github.io/ARtGallery/aframeroom.html
VR ART
https://dougsillars.github.io/ARtGallery/aframeroomart.html
VR More Art
https://dougsillars.github.io/ARtGallery/aframeroomart2.html
VR More Art
https://dougsillars.github.io/ARtGallery/aframeroomart2.html
VR More Art
https://dougsillars.github.io/ARtGallery/aframeroomart2.html
GLTF Models
GLTF Models
VR Models Are Large
We won’t forget optimization!!
AR with A-Frame
We’ll use AR.js to add AR functionality to the page
3D objects are placed with Markers:
AR Markers
http://bit.ly/ARHiro
AR Markers
Create Your Own Markers
https://jeromeetienne.github.io/AR.js/three.js/examples/mark
er-training/examples/generator.html
Creates an image to print and tape to
the wall.
Creates a .patt pattern file for the
browser
AR Markers
Create Your Own Markers
AR Markers to Create A Scene
https://dougsillars.github.io/ARtGallery/ARt.html
AR with WEBXR
AR with WEBXR
• All WebXR Demos require:
• Android 8.0+
• Chrome Canary v70-72 (late 2018)
• Flags enabled:
• WebXR Device API
• WebXR Hit Test
• ARCore installed
Protip:
If using WebXR a lot, prevent Canary
from auto-updating in Play Store
WEBXR Hit Test
https://codelabs.developers.google.com/codelabs/ar-with-webxr/#4
WEBXR Hit Test
https://dougsillars.github.io/ar-with-
webxr/WebXrARt/
Optimisations for AR/VR
• Images are integral to the view – we want them to load quickly
Optimisations for AR/VR
• Reduce File Size
Optimisations for AR/VR
• Reduce File Size
• Resize images (to power of 2)
https://res.cloudinary.com/dougsillars/image/upload/h_1024/v1552460601/
VanGogh-starry_night_qoohur.jpg
Optimisations for AR/VR
• Optimize Quality
https://res.cloudinary.com/dougsillars/image/upload/h_1024,
q_auto,/v1552460601/VanGogh-starry_night_qoohur.jpg
Optimisations for AR/VR
• Optimize Format
https://res.cloudinary.com/dougsillars/image/upload/h_1024,
q_auto,f_auto/v1552460601/VanGogh-
starry_night_qoohur.jpg
Optimisations for AR/VR
• Optimize Format
https://res.cloudinary.com/dougsillars/image/upload/h_1024,
q_auto,f_auto/v1552460601/VanGogh-
starry_night_qoohur.jpg
Optimisations for AR/VR
• Optimize Format
https://res.cloudinary.com/dougsillars/image/upload/h_1024,
q_auto,f_auto/v1552460601/VanGogh-
starry_night_qoohur.jpg
1.8 MB -> 323 KB
Optimisations for AR/VR
• Optimize Format
https://res.cloudinary.com/dougsillars/image/upload/h_512,
q_auto,f_auto/v1552460601/VanGogh-
starry_night_qoohur.jpg
1.8 MB -> 93 KB
Optimisations for GLTF
Draco Compression optimizes .bin files
Optimisations for WebXR
1024X1024 1024X1025
https://res.cloudinary.com/dougsillars/image
/upload/x_230,y_128,w_512,h_512,c_crop/
w_256/v1552682248/stabilization_yegbkb.gi
f
850 KB -> 174 KB
Optimisations for aGIF
Optimisations for PNG
https://res.cloudinary.com/dougsillars/image/upl
oad/q_auto,w_256/c_crop,w_256,h_256/v15526
82248/Anchor_rzjbco.png
• Optimise quality, shrink to 256
KB wide
• Crop to 256x256
• 36 KB -> 2.2 KB
Loading WEbXR Art Gallery (Optimized)
Conclusions
• AR on the web is available today with A-Frame
• AR with Hit Points is coming
• AR does not have to be processor intensive, nor utilize huge
amounts of data
Links
Code: https://github.com/dougsillars/ARtGallery
https://github.com/dougsillars/ar-with-webxr
WebXR spec: https://www.w3.org/TR/2019/WD-webxr-20190205/
Cloudinary: https://cloudinary.com
Love Building with Video and Images?
Media Developer Expert
mde-comm@cloudinary.com
Become a

ARt gallery

Editor's Notes

  • #15 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #16 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #17 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #18 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #19 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #20 https://dougsillars.github.io/ARtGallery/aframeHW.html
  • #21 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #22 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #23 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #24 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #25 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #26 https://dougsillars.github.io/ARtGallery/aframeroomart.html
  • #27 https://dougsillars.github.io/ARtGallery/aframeroomart.html