Weeks 16–17 (8 – 11 Oct) | Setting up the mixed-reality foundation

Written by

in

After the distance prototype I decided that the work would enter the viewer’s own room. Before making any content, I spent a few days setting up the mixed-reality foundation. The work is made in Unreal Engine 5.8 and runs as a standalone APK on Meta Quest 3. The whole experience uses bare hands, without controllers.

Step 1: plugin and runtime. I enabled the Meta XR plugin in the project, used its Project Setup Tool to check the rules a Quest build has to meet, and set the XR runtime to Epic’s native OpenXR. In the plugin settings I also switched on body tracking (upper body).

Meta XR plugin settings: the Project Setup Tool and platform window
Body tracking (upper body) switched on in the Meta XR settings
The Quest build rules listed by the Meta XR Project Setup Tool
XR runtime: Epic’s native OpenXR rather than the deprecated OVRPlugin

Step 2: headset and computer. In the Quest I ran Space Setup so that the headset scans and remembers my room, and turned on the developer options. On the computer I set Meta Horizon Link as the OpenXR runtime and switched on “Passthrough over Link” and “Spatial data”, so the room can also be read while testing in the editor.

Space Setup on the Quest: scanning the room to create walls, floor and furniture
Developer options on the Quest
Meta Horizon Link set as the OpenXR runtime on the computer
Link developer options: passthrough over Link and spatial data

Step 3: reading the room in the MRUK sample first. At first the sample showed zero rooms. I used MRUK’s built-in sample room (loaded from JSON) to understand the data it gives: walls, floor and each piece of furniture are each an anchor. Then I ran “Launch scene capture” in the headset and got my own room. The sample also has ray casts, nearest-surface queries and other functions; the automatic placement of the organs was later built with queries like these.

MRUK sample: at first the room count is 0
Testing with MRUK’s sample room first (Bedroom05, loaded from JSON)
Walls, floor and furniture of the sample room
After Launch scene capture, one room is loaded
MRUK core demos: room information, ray casts, nearest surface and more

Step 4: passthrough. I enabled passthrough in the plugin settings and turned on alpha output in the rendering settings, so the virtual image can sit on top of the real room. The level blueprint initialises persistent passthrough at the start and then requests the scene permission.

Passthrough enabled in the plugin settings
Level blueprint: SetupRoom and CleanupRoom
The Initialize Persistent Passthrough node and passthrough layer parameters
Initialising passthrough at the start, then requesting the scene permission
Rendering settings: alpha output on for passthrough, mobile HDR off
Passthrough layer settings: reconstructed passthrough, placed above or below the image (Overlay / Underlay)

Step 5: the VR template and the main level. I added UE’s VR template to the project, used its game mode and pawn (BP_XRPawn), and built the main level, connect. The first version held only a white ball, to test whether my hands could touch it and whether its position in passthrough was right.

Choosing the game mode
Adding UE’s VR template to the project
BP_XRGameMode from the VR template
The first version of the main level, connect: a white sphere for testing
Testing in my own room over Link: hands and ball
The ball and the real room in passthrough
Tracked hands and the test ball
BP_XRPawn event graph: input actions and the passthrough layer

Step 6: mobile rendering settings. For the Quest I turned on forward shading and mobile multi-view (both eyes rendered in one pass) and turned off mobile HDR.

Engine rendering settings
Mobile rendering settings: forward shading and mobile multi-view on, mobile HDR off

Step 7: the level blueprint reads the room; hands and menu (11 October). At the start, the level blueprint checks the headset, requests permissions, sets the tracking origin to the floor and initialises passthrough. Reading the room needs the Android permission USE_SCENE. If no room exists, it calls Launch Scene Capture on the MRUK subsystem and continues when the scan is finished. BP_XRPawn has an OculusXRHand component for each hand; I set them to hide the hand when tracking is unreliable and gave them my own hand material. A left-hand menu lets me switch passthrough, reset the orientation and restart inside the headset.

Level blueprint: check the headset and permissions, set the tracking origin, initialise persistent passthrough; destroy passthrough at the end
The Android permission com.oculus.permission.USE_SCENE, needed to read room data
Level blueprint: Launch Scene Capture on the MRUK subsystem, bound to the “capture complete” event
BP_XRPawn components: headset camera, an OculusXRHand for each hand, and interaction components
Hand component settings: hide the hand when tracking confidence is low; hand material replaced with my own M_hand
Input mapping: how the left-hand menu is triggered
The test menu in the headset: passthrough toggle, reset orientation, restart, quit

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *