Adding AR Functionality to Your MAGES Project¶
It is possible to also add AR functionality to your MAGES Project. In this tutorial we will follow some simple steps to make the Neuromonitoring Sample possible to play in AR on Meta Quest 2.
First of all you need to download the AR Foundation package through
Window > Package Manager
.Find the URP asset that is set as the default one in the Quality levels found in
Edit > Project Settings > Quality
. In our case, we need to search for the default URP Asset for Android, which is the URP-Balanced asset.Click on it so that it becomes highlighted on the Assets, then open it in the Inspector and make sure that HDR is disabled.
Click on the URP Data element inside the render list of the URP asset so that you find it in your Assets.
Open it on the inspector and click on the Add Render Feature button to add the AR Background Render Feature.
This is optional but it is possible to disable certain objects when entering AR mode (for example the walls) and enable them back when on VR mode. To disable the walls inside the Neuromonitoring Sample when entering AR mode open the OR Room object on the Inspector and add an AR Disabled Object component on it.
In this way the background of your operation will be the real room you are currently playing the application in.
The next steps revolve around setting up the XR Plugin Management settings correctly, which differ according to the device you will build your project for. In our case we want to play the operation on Quest 2, so we need to configure the following settings:
Install OpenXR and Unity OpenXR Meta from the Package Manager.
Navigate through
Edit > Project Settings > XR Plugin Management
select the Android tab and enable OpenXR and Meta Quest feature group.Note
If a red error icon appears next to OpenXR, you might need to fix the issues pointed by OpenXR. The yellow warning icon issues are not necessary to fix.
Open
XR Plugin Management > OpenXR
in the Project Settings, enable the Meta Quest feature group and add Oculus Touch Controller Profile as the Enabled Interaction Profile.
Now you are ready to build your application and test the operation in AR in your Quest Device!