Unity Meta SDK Anti-Occlusion Portal
Description
A "portal" you place on glass or transparent surfaces in a mixed-reality scene so virtual objects behind real-world glass render correctly on Meta Quest. The Quest's depth sensors track glass as an opaque surface, so anything virtual behind it gets falsely occluded — this patch cancels that.
What it does
It adds a green-channel mask to the depth mask (cameraRT) and replaces the
Meta SDK's environment depth manager. Meshes you register with the manager
aren't rendered themselves; they act as cut-outs that cancel real-world
environment-depth data behind them. Have a glass wall that keeps swallowing
your virtual scene? Drop a quad just in front of it and the occlusion stops at
the portal.
What's included
An editor GUI tool that patches the SDK files and backs up the originals, so
you can restore them without rebuilding the Library. The modified files ship as
.txt (to avoid compilation errors from missing asmdefs) and are renamed to
.cs during replacement. Repatching is needed whenever the Meta SDK updates or
the Library is rebuilt.
Compatible with Meta Unity SDK v77+ and Unity 6 or above (occlusion itself requires Unity 6, so that lines up). Licensing is per-folder — Meta's original license and an MIT license cover their respective parts.