Yurt-Unity tools, tips, and tricks

If you are looking for the Unity-Yurt porting guide, look here. You should not have to read this document if you are just porting.

Guide

This is a collection of resources, tips, and tricks for Unity-Yurt development. This should be used by maintainers of Unity in the Yurt and requires proficiency in Unity, C#, C++ and OpenGL.

The MinVRUnity unitypackage is an importable collection of the below which includes a modified MinVRUnity as well as plugins for SDL2, Scalable rendering and VRPN input.


This project is a version of Unity with MinVR scripts implemented in C# to interface with other Unity instances and/or a regular MinVR server.

MinVRUnity has a flag for enabling the right machine. Use -vrdevice <MachineName> to specify a specific device. For the Yurt, these devices are provided as a prefab (YurtConfig.prefab). To debug on any machine simply use -vrdevice Desktop.

Combining with a MinVR Server

To use an external MinVR server w/MinVRUnity, simply follow the regular instructions for standalone MinVR. Then, create an empty application.

Important: Do not use the full YURT.minvr configuration file with the server! MinVRUnity takes care of all the clients. Only the VRPN server and other external sources need to be run outside of Unity. MinVRUnity can even have certain nodes act as the server or standalone.


Native Plugins

Native Plugins are a way to utilize a preferred platform and/or graphics pipeline in Unity with (almost) complete control.

Here is the official Unity documentation regarding the low-level interface.

Here is the official Unity Native Rendering Plugin example for all operating systems and the major graphics APIs.

Native Plugins are used for both Scalable rendering (VRMain.cs) and VRPN integration (VRPN *.cs) with Unity.

Guidelines

If, when running in the Yurt, the console outputs: "Could not load plugin: [Plugin Name]", this either means the plugin .so file is not in the proper directory or that the build has unavailable library dependencies. The simplest solution is generally to build plugins directly on CCV machines.


Unity Launcher

This simple app is responsible for running all the instances of Unity in the Yurt. It is located in /gpfs/dhl/data/lcohen2/unity_launcher

Building on the Yurt

Make sure to load the latest cmake, gcc, scalable, opengl, vrpn, minvr and python modules. For loading modules see the Oscar documentation.

Important: ssh into cave020 when building to ensure the right resources are available.


Building MinVRRenderingPlugin

Copy /gpfs/dhl/data/lcohen2/UnityPluginSource to your own folder.

cd <your_path>/UnityPluginSource

mkdir build

cd build

cmake ..

make

The result libMinVRRenderingPlugin.so may then be copied to <app_name>_data/Plugins/ in your Unity project build folder

Building VRPNPlugin

Copy /gpfs/dhl/data/lcohen2/VRPNMeshClient to your own folder.

cd <your_path>/VRPNMeshClient

mkdir build

cd build

cmake ..

make

The result libVRPNPlugin.so may then be copied to <app_name>_data/Plugins/ in your Unity project build folder

Building SDL2

Copy /gpfs/dhl/data/lcohen2/SDL2 to your own folder.

cd <your_path>/SDL2

bash build.sh

Loudon Cohen