Skip to content

5G-MAG/rt-xr-unity-player

Repository files navigation

XR Unity Player

Under Development Version License

Introduction

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.

Additional information can be found at: https://5g-mag.github.io/Getting-Started/pages/xr-media-integration-in-5g/

Clone the Unity project

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

Build the project and install it on an Android device

Supported platforms

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.

Spatial audio support

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

Compiling rt-xr-maf-native

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.

Building and running the Unity project

Build the Unity project

  1. Locate the Build Settings menu
  2. Make sure that Android is the selected platform, change as needed.
  3. Check that Mobile XR is the default scene
  4. Select the device on which the application will be installed
  5. Build & Run

Upload content to an Android device & configure the player

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

License

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.