Menu

Lasertag

Multiplayer mixed reality that 'just works'

Website ➔

GitHub repo ➔

Several multiplayer AR shooter games exist on Meta Quest, but you need to fuss with room mapping, spatial anchors, IP addresses/room codes, etc. Setting up a game is a chore, especially with friends who aren't familiar with XR.

With Lasertag (lazy project folder name that stuck, sorry) I've obsessed over streamlining the UX, going as far as writing my own environment mapper that runs while you play instead of relying on Meta's painstaking room setup process.

The only setup required is a shared WiFi connection. One person hosts a session, and all the other headsets connect via bluetooth discovery and automatically align. Together, the headsets scan and synchronize their shared physical environment.

Continuous environment scanning

Scanning works on the GPU with a semi-sparse TSDF divided in chunks. The scanner has a fixed amount of data it can store, but it avoids reserving any of that for totally empty chunks. With 128 MB of fixed memory the scanner can store more than anyone will probably ever need.

I then mesh the chunks on the CPU with a surface-net job and a third party mesh decimation job. Collision, visual occlusion, and nav-mesh generation rely on these meshes.

I'd eventually like to use the scan for multiplayer localization and drift correction, but I'm still getting a handle on some necessary math.

I still need to properly profile all of this, but it runs pretty efficiently at a glance. Lasertag holds a steady 72fps during play with CPU and GPU usage hovering around high 40s to low 50s. Any GPU spikes are usually due to the depth lights...

Depth-based relighting

Laser bullets glow and cast light on the real environment with depth & normal sampling inverted spheres. They're just naive deferred lights. These are pretty inefficient with multiple texture samples per sphere. TODO FIX!

Trailer