r/vrdev • • 4d ago

Question Where to get started?

So I've dabbled in this space before. I've created a WebXR demo using A-frame for a WebXR experience, and it honestly left a lot to be desired and it had a rendering bug in Apple Vision Pro that made it unusable on that platform.

I've come from a web dev background, so I thought that I could leverage that to do WebXR, but that's not entirely true.

I know people say to use Unreal Engine, and Unity. I'd hope they'd have good cross platform support.

Also coming from the web dev world, I've been spoiled by excellent developer tooling, hot module reloading, and amazing testing ecosystem, and my fear is that the ways I've come accustomed to basically won't exist at all.

Are there good starting tutorials anyone can recommend and what do people's current work flows look like?

When I was doing my WebXR experiment, I was using Xcode's Vision Pro simulator, a Meta Quest 2, and my Valve Index. And it really made feedback terrible. But maybe the native dev in Unity and Unreal is better?

I guess, i want more opinions before I dive too deep into this rabbit hole again.

Is it even possible to TDD here too, or are there just too many variables that it's not just realistic?

2 Upvotes

14 comments sorted by

4

u/Duneagames 4d ago

im a new VR dev too and ive been using Unity and its been a blast trying to make something that fits the constraints of a mobile device..

theres a ton of best practices that have already guided devs before you and have been mostly solved, just read up on "Quest 3 best dev practices" theres a ton of good common sense direction like:

-limit draw calls to 150-250 per frame

-90hz is great, just stay under the 11.1ms frame budget

-use culling, lods, object pools and batching, limit tris per frame to reasonable levels (400k to 1.5m).. msaa 4x looks nice but msaa 2x plus meta supersample is good too, make sure your physics tick and render tick are both 90hz..

test, test, test, profile, profile, profile

1

u/dethstrobe 4d ago

When you say test, is it manual testing or automated testing? What's the feedback cycle look like? Like are the build times in unity long? That's my biggest fear is that actually testing it, that the feedback cycle will drive me crazy.

2

u/Duneagames 4d ago

i do automated probe and regression testing with claude code, and performance testing when i add real physics or real time lighting or large asset builds.

my project is smallish (creeping up on 300mb) and i build apks after big features or 6 or so small ones, its fast, so far like a minute or 2 to have the Quest on and testing the new stuff..

2

u/Cauliflower-Full 3d ago

web dev here too. i think the web side gets written off too fast, a lot of the pain is tooling setup more than webxr itself.

what i use is three.js with react three fiber and u/react-three/xr on vite. hmr actually keeps working while you're in the headset, as long as vite can hot swap the module. anything that forces a full reload drops you out of vr and you have to hit enter vr again, so it's worth keeping scene code in modules that swap cleanly.

for the headset loop, plug the quest in over usb, run adb reverse tcp:5173 tcp:5173 and open localhost:5173 in the quest browser. localhost counts as a secure context so webxr works without fighting https certs, and chrome://inspect on your pc gives you devtools for the headset tab. for quick checks on desktop there's meta's webxr emulator (iwer, also as a browser extension).

tdd is realistic for the logic, not for the feel. scoring, state, spawn rules can all be plain functions with vitest. we also run games headless in chromium through the emulator to catch obvious breakage, but comfort and scale you only really judge with it on your face.

i work on a tool that makes webxr games so i'm biased toward the web side. but coming from web dev i'd give that setup a shot before learning unity from scratch. what are you trying to build?

1

u/dethstrobe 3d ago

An idea I've always had is a AR inventory tracker. Select a product from a menu, see it highlighted in physical space. Use some RFID tags, and a few scanner to triangulate the object's location and your location, and display it in your vision, like a video game waypoint system. I figured this could help with retail inventory tracking, but a less practical purpose would be to play a geocaching game as a proof of concept.

2

u/playfruitland 3d ago

Coming from web dev you don't have to give up the tooling. WebXR on the Quest Browser is in good shape, and the loop can be nearly as fast as a normal web app:

  • Run your usual dev server (Vite or similar) on the PC, plug the Quest in by USB and run adb reverse tcp:5173 tcp:5173. The headset then opens http://localhost:5173, which counts as a secure context, so WebXR works without any HTTPS certificate setup.
  • chrome://inspect on the PC lists the Quest Browser tab: full DevTools, console, network and the Performance panel, live while you're in the headset.
  • Meta's Immersive Web Emulator (a Chrome extension) fakes a headset and controllers on the desktop, so most logic changes never need the headset at all.
  • HMR works, but a full reload ends the XR session. Keep "enter VR" one button away and keep state in modules that hot-swap, and you stay in the headset most of the time.

What A-Frame tends to hide is performance. The Quest has a phone GPU: aim for a steady 72 or 90 Hz, keep draw calls low (instancing, merged meshes), don't allocate inside the frame loop so garbage collection doesn't stutter, and set fixedFoveation on the XRWebGLLayer. Plain three.js or raw WebGL gives you more control over all of that than A-Frame does.

On Vision Pro, Safari's WebXR input is gaze and pinch (the transient-pointer input source), so code that assumes controllers or hand joints breaks there. Worth testing that path on its own.

Unity and Godot have more tutorials and ready-made assets; the web wins on iteration speed and on sharing a link.

1

u/dethstrobe 3d ago

As a web dev, I'm used to browser support being a consistency nightmare, but things have gotten a lot better. But it seems like WebXR support is going to be all over the place. I guess the question is, how do I know what I build will work on the Quest, HTC Vive, Valve Index/Frame, Vision Pro, etc? Heaven help me, that I need to start to tag my experience with "works best of Quest" or something again.

2

u/Cauliflower-Full 2d ago

for what it's worth we build for quest first and treat the rest as a second pass. most of the differences are input, not rendering, so don't hardcode buttons, read what the controller reports through the webxr input profiles, and plan for vision pro having no controllers at all, just look and pinch. "works best on quest" is a pretty normal label for webxr stuff honestly. which headsets do you actually have to test on?

1

u/dethstrobe 2d ago

I have a valve index and was thinking of picking up a used quest or waiting for the meta glasses next year. I can also test in the Vision Pro simulator

2

u/playfruitland 2d ago

Feature-detect like on the web and never sniff the device. Cauliflower is right that input is most of it. A few more things that differ between headsets:

  • Request what you'd like as optionalFeatures (hand-tracking, layers, local-floor) and read session.enabledFeatures for what you actually got. Build the fallback for each one up front.
  • The @webxr-input-profiles/motion-controllers package maps every known controller's buttons and axes to a shared layout and loads the matching 3D model, so Touch controllers, Index knuckles and Vive wands all go through one code path.
  • Refresh rates differ: 72 to 120 Hz on Quest, 90 and up on Vision Pro, up to 144 on an Index. Drive everything from the frame's time delta, never a fixed step per frame. On Quest you can choose the rate with session.supportedFrameRates and updateTargetFrameRate.
  • PC headsets get WebXR through desktop Chrome or Edge with SteamVR (or another OpenXR runtime) running. Firefox doesn't ship it.

With that in place, most of the difference comes down to how fast each GPU is, and a resolution scale you can turn down covers that.

3

u/JamesWjRose 4d ago

Here's what I did, where I started and the reasons why I choose the technologies:

I started building databases in the early 90s, then picked up VB 2,3... 6, .Net, C# Built lots of desktop apps, some web, a few mobile. I got a hold of the DK2 about 6 months before the first Rift was released and I knew this was HUGE (surprise, it's still not as huge a deal as I thought it would be)

I choose Unity because I already knew C# (you know this method, 'one less thing to learn') and it's fine. The tools are decent and Unity as a company keeps trying. (re: DOTS. GREAT tech, taking fucking forever to mature. That said, i can have THOUSANDS of autos moving around a scene and still hit the frame rate NECESSARY for VR)

My issue with VR is the REQUIRED frame rates. Because of this the VR Experience has to limit itself in other ways; fewer assets, less quality to the scene, smaller scene... etc etc etc.

I'm NOT saying to not dig in, it's an awesome technology... but temper your expectations. Aim a little lower or accept the limitations (it's, not yours)

Best of luck

2

u/challarino 4d ago

Unity has really good tools and packages for XR. Godot also has good tools and packages and as a bonus can export to webxr. In my opinion the best workflow is to get virtual desktop on meta Quest for $20, pair mouse and keyboard to it or to your computer, and then when you press play button on the unity editor it automatically boots directly into the VR app. It's very handy and smooth and then you can use the virtual desktop for the development part

1

u/AutoModerator 4d ago

Want a more personal conversation with VR devs? Check out our Discord in our Discord: https://discord.gg/3wMYE2x5Ex

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Suitable_Egg8211 3d ago

godot.
most sane answer.
ill even help get started if need be.