[HN Gopher] WebXR
       ___________________________________________________________________
        
       WebXR
        
       Author : based2
       Score  : 65 points
       Date   : 2023-05-27 19:00 UTC (4 hours ago)
        
 (HTM) web link (immersiveweb.dev)
 (TXT) w3m dump (immersiveweb.dev)
        
       | kevlened wrote:
       | You can experience this on iPhone by installing Mozilla's WebXR
       | Viewer [https://apps.apple.com/us/app/webxr-viewer/id1295998056],
       | then opening the dinosaur demo [https://www.xrdinosaurs.com/]
        
         | dmarcos wrote:
         | Important to mention. Team at Mozilla was affected by layoffs a
         | couple of years back and the WebXR viewer is no longer
         | maintained. Ships an old version of the WebXR API. Don't
         | recommend as dev target
        
       | jade-cat wrote:
       | Wonder what's the story behind this not being made by the Khronos
       | Group. Especially since, at least according to Wikipedia, it's
       | based on Vladimir Vukicevic's work.
       | 
       | The name choice is interesting. If one of the first things in
       | your FAQ is "the name probably made you think this is thing X.
       | it's not", then maybe there was a flaw in your naming process.
        
         | bckr wrote:
         | I think this is the wrong post
        
           | jade-cat wrote:
           | I'm talking about WebXR, which is for some reason the name of
           | the standard developed by W3C.
           | 
           | "As such it may seem like WebXR and OpenXR have a
           | relationship like WebGL and OpenGL, where the web API is a
           | near 1:1 mapping of the native API. This is not the case with
           | WebXR and OpenXR, as they are distinct APIs being developed
           | by different standards bodies."
           | 
           | from https://github.com/immersive-
           | web/webxr/blob/master/explainer...
        
             | moron4hire wrote:
             | There are many other browser APIs named "WebSomething".
             | WebAudio, WebUSB, WebBluetooth. This is a really silly
             | complaint to have.
        
         | dmarcos wrote:
         | If you want Apple involved they don't like working under
         | Khronos. IP disputes in the past. See also WebGPU
         | 
         | API started as WebVR, was renamed to WebXR since now
         | accommodates more than VR (AR, MR...)
         | 
         | I worked with Vlad at Mozilla in the early WebVR days (I co-
         | design while at Mozilla and now maintain A-Frame)
        
       | prophesi wrote:
       | Won't be touching WebXR again until iOS implements it. There's an
       | experimental feature flag to enable it, so hopefully this
       | actually happens soon.
        
         | te_chris wrote:
         | Not sure why you're being downvoted. Not being able to deploy
         | to the most powerful devices is a real constraint of actually
         | using the API
        
         | IshKebab wrote:
         | Why would you want this on a phone though? It's for VR
         | headsets.
        
           | fmajid wrote:
           | You want one API that will work on all devices. Take this
           | demo:
           | 
           | https://aframe.io/examples/showcase/sky/
           | 
           | On a VR headset you can just crane your neck and look around.
           | On a phone or tablet it will use the accelerometer and let
           | you use the device as a window on the virtual reality. On
           | desktop you can use the mouse to scroll around.
        
           | jonas21 wrote:
           | It's for VR and AR. That's why it's called WebXR.
        
         | morganw wrote:
         | https://twitter.com/AdaRoseCannon
         | 
         | https://twitter.com/fernandojsg
         | 
         | https://bugs.webkit.org/show_bug.cgi?id=208988
         | 
         | https://webkit.org/status/#specification-webxr Status = "In
         | Development"
        
       | hoc wrote:
       | For me the main advantage of WebXR is that one can create complex
       | 3D objects at runtime/on the fly without havjbg to load them as
       | assets or compiling them into the binary.
       | 
       | Any thougts on the best way to do this in classic runtimes like
       | Unity or Unreal (which scripting plugins, which base construction
       | objects/assets?)?
       | 
       | The main issue I have with WebXR, though, is it being canvas-
       | based instead of being page/HTML-based, resulting in graphic-
       | oriented products instead of structure-oriented ones (e.g. 3D web
       | pages) which would allow placing all the dynamic and complex HTML
       | objects that were developed over the last few years. Any good
       | known approach to solve this?
        
         | andybak wrote:
         | Not sure what you're asking, exactly?
         | 
         | Unity (and I presume Unreal) can do the same procedural
         | generation stuff today your can do in js. There's many
         | libraries/tutorials etc
        
           | hoc wrote:
           | Basically i'd like to add, edit, store and load code during
           | runtime.
        
             | Uehreka wrote:
             | Just a heads up, when folks say "complex 3d objects", it's
             | usually assumed that they're talking about things like GLTF
             | files, which contain geometry, materials, lighting
             | elements, animations, etc, and which Unity/Unreal can
             | absolutely load/unload at runtime or even stream from a
             | media server online (so they don't have to be in the
             | binary).
             | 
             | However, once you cross over into scripting code, you are
             | in fact crossing a barrier, and it does become harder to
             | hot-reload the way you can in a JS app. Like, the fact that
             | Unity scripts are written in C# and have to be compiled and
             | linked is a pretty huge impediment that you don't face when
             | loading almost any other kind of asset.
             | 
             | I'm right there with you: Hot-reloading and 3D is a
             | thrilling combination, and tools like react-three-fiber are
             | miles ahead of anything I've seen in Unity-land in terms of
             | laying foundations for stuff like this. I'd recommend
             | emphasizing "hot-reloading code" when drawing this
             | distinction with Unity/Unreal folks to better get across
             | the magnitude of what you're looking for.
        
             | andybak wrote:
             | Oh, code? I assumed you meant geometry and/or materials.
             | 
             | Yes, it's possible. I can think of several ways to approach
             | it. Not quite as cleanly as with javaScript, mind.
        
         | WesSouza wrote:
         | CSS supports many 3D transforms, I wonder if VR browsers
         | implement that in any sort of 3D plane.
        
           | hoc wrote:
           | Cool.
           | 
           | If I could xr-dive into a css-3d-transformed world of objects
           | instead of having them projected onto the 2d window right
           | away, that would be what I was looking for in the second part
           | of the comment above. Not sure if WebXR perspective and a 3d
           | space is provided right now at the same level these css
           | transforms are used.
        
           | Arathorn wrote:
           | you can calculate 2D CSS transforms which match the
           | equivalent transforms of your WebGL scene in WebXR - as an
           | efficient but hacky way to (for instance) do live video
           | overlays in 3D without having to mess around importing the
           | video texture into WebGL (assuming you don't need occlusion
           | or environmental effects etc).
           | 
           | we're toying with this as an approach for video overlays in
           | https://thirdroom.io, especially for underpowered devices.
        
         | doctorpangloss wrote:
         | You can stream it. Here's an example using Unity:
         | https://appmana.com/watch/virtualtestdrive
         | 
         | For runtime loading in such an architecture, you can using an
         | asset like TriLib.
         | 
         | There are many streaming ideas. Most were poorly executed. I
         | wouldn't generalize based on those. It is definitely the future
         | of delivery for many reasons besides technology.
        
       | diegocg wrote:
       | This is the kind of thing that makes me lose any hope in web
       | browsers. Normal browsing is getting worse, web apps are still
       | unable to provide a truly native-like experience. But instead of
       | fixing these core problems, let's add yet another corner case
       | API...
        
       | fmajid wrote:
       | It's a low-level API. You'd typically use it under something like
       | Aframe or Three.JS.
        
       | folli wrote:
       | Some time ago, I created a tech demo to display topographical
       | terrain models in AR (the ultimate goal is to be able to show GPS
       | tracks as an AR model on your desk), see here:
       | https://r-follador.github.io/cubetrekXR/
       | 
       | It makes use of Model-Viewer, which in turn uses Scene Viewer and
       | ARCore on compatible Android devices, and Quick-Look and ARKit on
       | compatible iOS devices.
       | 
       | At the bottom there's also a WebXR implementation using
       | Babylon.js.
        
       ___________________________________________________________________
       (page generated 2023-05-27 23:00 UTC)