WebXR
immersiveweb.dev
immersiveweb.dev
People who say JS on the Quest 2 isn't fast enough to do good VR don't know what they are talking about. The problem is that a lot of small, indie developers only know the most naive way to implement things and then blame the platform for their lack of algorithms training.
I had originally started the project in Unity 3D. I eventually rewrote everything in WebXR because--while the naive path in Unity was faster than WebXR--the ideal path in Unity was nearly impossible to implement. I haven't done anything in Unity for about 3 years now, so maybe it has changed, but basic things like decoding textures happen on the render thread, which makes it impossible to use the Unity happy path to implement a dynamic XR app that wasn't prone to making people puke. While I was still tilting at the Unity windmill, I had a large amount of code that was just dedicated to decoding images before using them as textures, tasks Unity should have been able to handle itself, except for the fact that Unity is built by people who have never had to make a game or app themselves before.
There's a reason the loading screens on VR Chat are so long and boring--they can't slipstream live objects in because they haven't done the hard work of throwing away 90% of Unity's bullshit framework code. So they have to hide the dropped frames behind a scene fade-in/fade-out.
With WebXR, you get the full browser ecosystem to work with. Web Workers. Web Audio being off-render-thread by default. Fetch API. IndexedDB. It's somewhat popular to complain about Web APIs because some of them have some weird quirks and most of them don't agree on how to design an API, but you have no idea how much worse it can get. If you think browser app development is bad, trying making an app in Unity sometime.
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.
"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...
Source: I was there for the discussions.
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)
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?
Unity (and I presume Unreal) can do the same procedural generation stuff today your can do in js. There's many libraries/tutorials etc
Yes, it's possible. I can think of several ways to approach it. Not quite as cleanly as with javaScript, mind.
Sorry for not being clear on the code part. I assumed USD and the like would be the norm now. "Complex objects" is not really helpful in this context, though.
I am assuming code means "executable code" - I know the boundaries are fuzzy here and some file formats are Turing complete - but I guess what I'm saying is that I'm still not sure what you're asking!
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.
I recently had more contact with gaming engines than I originally wanted and there's always this kind of community-specific vocabulary whenever you cross borders. Oh no,like in real life.
https://github.com/gregfagan/blog/blob/main/xr-remote-displa...
You don’t actually need this if you’re just working on graphics, as usually a flat projection is fine, but it is quite nice to work inside your own XR app while iterating on the interaction.
Unfortunately I find myself cycling thru needed components for interactivity these day and being stuck between competing SW and HW constraints.
Will give it a closer read next week.
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.
we’re toying with this as an approach for video overlays in https://thirdroom.io, especially for underpowered devices.
But currently probably it what's there. Would this work as well for other HTML content, like dynamically projecting a whole DIV into/over a canvas scene that I would then be able to have positioned over some surface in VR?
Love the product/concept, btw.
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.
So many great exec environments already for WASM. Is there already something available for Unity? Maybe even with a source language and compiler built in?
My focus currently is on creating code inside a running app (by the user) with references to selected Unity objects and their methods. While WebXR is great for this, the first (and sometimes only) SDK implementations for certain devices are usually in Unity.
WASM probably ist great for hotloading but would need a more complex toolset available at runtime to edit and create. Interactivity and incremental code creation would also be better in a scripting envirnment.
I'm using Moonsharp which is interpreted rather than jitted but Blua looks promising if performance on the Lua side is critical.
I got around lua so far, but bindigs seemed easy and a friend just chose it over integrating python just recently, so it seems to be getting some traction again, especially in tools and such to get a first step beyond a purely graphical UI.
Scroll to the bottom of the list.
There are 4 WebXR APIs behind a flag.
Why waste precious WebKit resources on implementing WebXR APIs in Apple's browser engine… if WebXR will hypothetically never be shipped to Safari stable?
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.
Sometimes I really hope the AIs take over sooner rather than later.
AAA games that pushes HW to the limit is a small fraction of all content. Among most popular content on Quest you have VR Chat, Gorilla Tag, Beat Saber, Job Simulator: Indie titles def not AAA that the browser would be more than capable to deliver today. https://moonrider.xyz/ for example has 60-100k VR MAUs (300k at peak on Holyday season 2021). Tech is no longer a blocker to build good WebXR content and grow an audience. Mozilla, Google and now the Meta Browser team have done excellent work to get us here
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.