The VR manager

Introduction

The VRManager is simpy a Unity GameObject with several scripts attached to it :

Those script handle all the management of 3D nodes, cameras, viewports, devices, clustering.

The VRManager will initialize MiddleVR with the specified options, especially the config file. It will create the 3D hierarchy of nodes that you've specified in the configuration tool and the cameras with their respective viewports.

It will then automatically update MiddleVR, and then reflect all the updates of 3D nodes and cameras to Unity3D.

All the devices data will also be updated so you have the latest information about your input devices.

NOTE: The VR Manager will not have any effect on your application before you press play. More precisely, no object of the VR hierarchy (3D nodes, cameras, screens) will be created unless you run your application.

MiddleVR automatically disables any existing camera of your scene for performance reason. Indeed, the more cameras render their view, the slower your application might be. You can change this behavior with the "Disable Existing Cameras" option.

VR Manager properties

Table 6.1. VR Manager properties

Config FileSpecifies the absolute path to the configuration file that should be used.
Root NodeSpecify the parent of the VR hierarchy.
Template CameraCamera to duplicate instead of creating new cameras for each VR camera. If you set the Template Camera option to an existing camera in your scene, this camera will be duplicated for each VR camera instead of creating a new one. This is useful if you want to have on all VR cameras scripts (like image effects [SSAO, Blur...] ), parameters (clear color), or any other component like Flare Layers, GUILayer etc.
Show WandShow the Wand geometry. Pressing Shift-W will toggle wand on/off.
Show FPSDisplay the frames per second. Pressing Shift-D (like "D"ebug) will toggle display on/off.
Disable Existing CamerasWill parse the scene to find existing cameras that don't belong to the MiddleVR hierarchy and disable them. This is mainly done for performance reasons.
Grab Existing NodesWill parse the scene to find existing nodes that match a node name in the MiddleVR hierarchy. The existing node will then be inserted as part of the MiddleVR hierarchy.
Debug NodesWill display the nodes of the MiddleVR hierarchy as transparent blue cubes. This allows for easy debugging of their position and orientation.
Debug ScreensWill display the screens of the MiddleVR hierarchy as transparent blue rectangles. This allows for easy debugging of their position, orientation and size.
Quit On ESCWhen in a standalone player, will exit the application if the Escape key is pressed.
Don't Change Window GeometryMiddleVR will not try to change the player's window size, position or resolution.
Simple ClusterEnable the Simple Cluster option. See section "Clustering" for more information.
Force QualityForce a specified Player Quality. See below for more information.
Force Quality IndexIndex of the Player Quality to force. See below for more information.
Change World ScaleEnables the World Scale option
World ScaleScales the position of the VR nodes and size of VR screens so that the world appears bigger or smaller. Will not modify the actual scale of the scene.


Force Player Quality

Usually when you start a Unity application / player a startup window pops up asking for the resolution you want to use and the player quality that should be set. MiddleVR deactivates this window because it will automatically handle the resolution. When exporting a Unity application, you can select what should be the default quality:

In this example, the default player quality will be "Good", because the second column (Windows build) is checked green.

There is currently a bug in Unity where the quality currently selected (here in blue) in the Unity editor will set the quality of the next Unity player that will be run. In cluster mode, there bug can also appear and select a random quality.

The "Force Quality" option from the VR Manager will allow you to force the specified "Force Quality Index" to the quality you want to be applied. The index is starting at 0 for the first quality (here Fastest).