Lab 036 – Virtual “Reality” Glasses

What if we could put on a pair of glasses that let us see out a virtual space back into reality?

No code to share for this lab. Here I just load a scene from Reality Composer Pro and add some gestures. The 3D model of the frames is from The Base Mesh. I was too lazy to make a pair of lenses in Blender so I cobbled together a few cylinders and scaled the to fill the slots. Then I added the same occlusion material to them all.

Simulator demo of a pair of low-poly glasses rendering an occlusion material in a virtual scene.
wow
like really, wow

Video demo of a pair of low-poly glasses rendering an occlusion material in a virtual scene.

This loads a Reality Composer Pro scene with a dome and a pair of classes that uses Occlusion Material on the lenses.

struct Lab036: View {
    var body: some View {
        RealityView { content in
            guard let scene = try? await Entity(named: "Glasses", in: realityKitContentBundle) else { return }
            content.add(scene)
            guard let entity = scene.findEntity(named: "Offset") else { return }
            entity.components.set(ManipulationComponent())
        }
    }
}

Updated 2025.08.16 use Manipulation Component and .immersiveEnvironmentBehavior(.coexist) on the app scene.

Support our work so we can continue to bring you new examples and articles.

Questions or feedback?