Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XR Unity Player

Under Development Version License

Introduction

The XR Unity Player is an interactive and XR-capable glTF scene viewer supporting glTF extensions specified in the MPEG-I Scene Description framework (ISO/IEC 23090-14), implemented in Unity3D. These extensions support features such as video textures, spatial audio sources, interactivity behaviors, AR anchors, ...

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

About the implementation

The project supports the latest Unity3D LTS editor release, Unity 2022.3.

The XR Player feature set dependends on the target platform. See the features page implementation status.

It is currently developped, tested and built for Windows and Android targets.

Downloading

The project has dependencies which are not delivered through UPM (Unity's Package Manager), but instead are tracked as git submodules.

clone the project and fetch all submodules

mkdir gltfsceneviewer && cd gltfsceneviewer
git clone https://github.com/5G-MAG/rt-xr-unity-player.git .
git submodule update --init --recursive

Install dependencies

The project has dependencies which aren't supplied through UPM and are maintained on the 5G-MAG github organization:

  • rt-xr-glTFast: a fork of com.atteneder.glTFast
  • rt-xr-maf-native: C++ media pipelines

Important

Refer to this documentation if you are contributing to these dependencies.

Building

Building the Unity project

Build the Unity project

  1. Locate the Build Settings menu
  2. Review the target platform, change as needed
  3. Review the build type
  4. Build

Changing the build target platform

Build target configuration

  1. in the build settings, select the target platform
  2. click on the "switch platform" button

Configuring the project

Configure the default scene

The XR player allows configuration of a default scene URI, which can be overiden when running the player from the command line.

Default scene configuration

Configure an Audio spatializer SDK

Support for spatial audio, Unity3D requires an Audio Spatializer has to be configured in the project settings Edit > Project Settings > Audio > Spatializer Plugin.

Audio spatializer configuration

If no audio spatializer plugin is configured, audio will play without spatialization.

Please refer to Unity's documentation for details and a list of available plugins.

Unity provides a native audio spatializer SDK with a simple spatializer implementation.

Configure an XR Plugin

https://docs.unity3d.com/Manual/xr-configure-providers.html

Running

The player can be launched from a command line specifying a scene document to load:

Launch scene over command line

If no gltf document is specified, the default scene configured in the project is used.

XR

If an OpenXR HMD is detected, it is used to render and control the camera.

Otherwise, the player renders in a regular desktop OS window, and camera is controled using keyboard and mouse.

Mouse & Keyboard controls

Key Action
mouse drag look around
arrow UP move forward
arrow DOWN move backward
arrow LEFT move left
arrow RIGHT move right
mouse wheel move up/down
left shift faster
right shift faster
Tab reset main camera
L toggle log overlay

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.