How can I create AR walls to hide virtual objects behind real walls?

Godot Version

4.3

Question

I’m the proud owner of a Meta Quest 3 and I started making a clone of the popular Laser Limbo to test Godot’s XR capabilities as a small project. Managed to setup a simple scene in passthrough for now. There is however one issue remaining :

Laser Limbo uses boxes placed on top of real walls/obstacles to “force” the virtual rendered scene to be transparent, letting the camera feed go though and successfully hiding virtual objects behind real objects/walls.

Basically how can I use objects as transparency masks for the whole rendered frame in order to prevent the virtual objects from obstructing the camera feed ?

Nevermind I just found the answer here.

https://godotvr.github.io/godot_openxr_vendors/manual/meta/passthrough.html

Exactly what I needed !

If you’re still curious, @mux213 does this in one of his game-jam videos - https://youtu.be/XvXyd5Z8wFc?t=5971

The shader that does this is available in his repo at godottoy/materials/global_mesh.gdshader at master · BastiaanOlij/godottoy · GitHub

1 Like