The XR Unity Player is an interactive and XR-capable glTF scene viewer implemented in Unity3D. It supports glTF extensions specified in the MPEG-I Scene Description framework (ISO/IEC 23090-14). These extensions support features such as video textures, spatial audio sources, interactivity behaviors, XR anchors,...
The project has dependencies integrated as Unity embedded packages.
- rt-xr-glTFast : This package supports MPEG-I glTF extensions, it is installed as a git submodule : github.com/5G-MAG/rt-xr-maf-native
- rt-xr-maf-native: Supports media pipeline plugins, see the package's README for details. It must be compiled and installed manually : github.com/5G-MAG/rt-xr-maf-native
Additional information can be found at: https://5g-mag.github.io/Getting-Started/pages/xr-media-integration-in-5g/
When cloning the project, use the --recursive flag to pull rt-xr-glTFast.
git clone --recursive https://github.com/5G-MAG/rt-xr-unity-player.git
Note
When pulling changes, submodules aren't updated by default. It has to be explicitly requested, eg. using: git pull --recurse-submodules
While the project is currently primarly developed for and tested on Android devices, it can be compiled and on Windows, Mac OS, and Linux.
By default, the project is compiled for Android 9.0 (API Level 28), targeting arm64 architexture.
This can be changed in Unity's "Player settings" panel, under the "Settings for Android" tab, in the "Other settings" section.
Mobile XR scenarios using the MPEG_anchor glTF extension are supported on Android through the Google ARCore plugin. When you enable the Google ARCore XR Plug-in in Project Settings > XR Plug-in Management, Unity automatically installs this package if necessary. Google maintains a list of compatible XR devices.
Support for audio spatialization requires the installation of an audio spatializer plugin. When an audio plugin is not installed, audio play but will not be spatialized.
See the related documentation
Android
The easiest way is to compile the media pipeline plugins is by using the Dockerfile:
git clone [email protected]:5G-MAG/rt-xr-maf-native.git
cd rt-xr-maf-native
docker build -t rtxrmaf:builder .
Then install the build artifacts into the unity project:
cd rt-xr-unity-package
docker run --mount=type=bind,source=$(pwd)/Packages/rt.xr.maf,target=/install -it maf:builder
Other platforms
Refer to the git repository for more informations on the build process.
- Locate the
Build Settings
menu - Make sure that Android is the selected platform, change as needed.
- Check that Mobile XR is the default scene
- Select the device on which the application will be installed
- Build & Run
This section assumes adb is installed on the machine, and Android smartphone is connected, with developer mode enabled on the phone.
Clone the rt-xr-content
repository:
git clone https://github.com/5G-MAG/rt-xr-content.git
Push glTF content to the phone:
cd rt-xr-content
adb push ./awards /storage/emulated/0/Android/data/com.fivegmag.rtxrplayer/files/awards
Create a file named 'Paths' listing gltf documents to be exposed in the player, one per line:
/storage/emulated/0/Android/data/com.fivegmag.rtxrplayer/files/awards/scene.gltf
/storage/emulated/0/Android/data/com.fivegmag.rtxrplayer/files/awards/scene_floor_anchoring.gltf
Upload the 'Paths' file to the Android device:
adb push ./Paths /storage/emulated/0/Android/data/com.fivegmag.rtxrplayer/files/Paths
This project is developed under 5G-MAG's Public License. For the full license terms, please see the LICENSE file distributed along with the repository or retrieve it from here.