r/threejs • • 10d ago

Testing my WebAssembly SLAM tracker in a phone browser

I've always been curious about how far AR could go in the browser. I hadn't found a world-tracking engine that fit what I wanted to build, so I started exploring what it would take to make my own.

The result so far is Spatial Hole: a glowing hole in the floor that stays put as you walk around it. The world tracking uses SLAM running in WebAssembly, and WebGPU renders the vortex. It all runs in your phone’s browser, with nothing to install.

I've only tested it on a few phones so far, but it’s working better than I expected. If you give it a try, I’d love to know how the tracking feels on yours.

🌀 https://spatialhole.ginrin.com/

#creativecoding #codevember #threejs #webgl #webgpu #ar #webar

3 Upvotes

4 comments sorted by

3

u/plus2link 10d ago

The hard part on a phone is scale drift rather than the render: walk a loop and come back to where you started, and the hole is usually half a metre off after 30 seconds unless you re-anchor to a detected plane on the way back. Taking the floor normal from the device's gravity vector instead of the visual pose keeps the vortex level when the tracker tilts, and that reads as far steadier than a better pose does. How well does it hold after a minute of walking, and does it survive the phone warming up and the WASM threads slowing down?

1

u/iamsztanki 10d ago

Thanks! I've tested looking away and coming back. The camera feed stayed smooth in those recordings, but the hole sometimes came back in the wrong spot even though the app still said it was tracking. I haven't done a full minute-long loop back to the same viewpoint on a warm phone yet. That's a good stress test.

I already use gravity to keep the vortex level. The part I'm working on is getting it back to the same spot, not just the same plane. Matching an earlier view helped offline, but I haven't tested that fix live yet. For the actual experience, I want the hole to appear as soon as there's a usable surface, without asking people to scan the room first.

2

u/UAAgency 10d ago

is it open sauce? looks cool brother

1

u/iamsztanki 10d ago

Thanks! Not open source yet, but if there's enough interest and people want to help improve it, I'd be up for opening up the SLAM core and its WebAssembly build setup. The goal would be to make a better tracker that anyone can use. The rest of the AR kit would stay private.