Facebook’s Oculus released a new update to its Unity integration package to make it easier for developers of Rift-only games to port to HTC Vive. The new “cross-platform development support” was added in version 1.31.0. The release notes state that this is an experimental feature, and that it “may change or be removed”.
The Situation Until Now
What makes modern game engines like Unity so useful for both developers and end users is that they support many platforms with the same project and code — eliminating development time to “port” a game from one platform to the other. The lofty goal of Unity is to let you focus on actually making your game and let the engine itself worry about platform differences.
However in reality, things aren’t quite so simple — especially in the VR space. Unity supports the Oculus API and SteamVR API with no effort from the developer required, but this support is fairly limited to essential features. So Oculus and Valve each provide Unity packages on top of these APIs — the Oculus Integration and SteamVR Plugin. These packages contain scripts, prefabs, resources, example scenes, and extra APIs to allow developers to have more than just the barebones VR support that Unity’s engine provides.
The problem is, the SteamVR Plugin does not directly support the Oculus API, and Oculus Store requires submissions to have direct Oculus API support to be approved. If a developer wanted to release on the Oculus Store for Rift and Steam for Rift and HTC Vive, they had to use both packages, or the generic Unity XR framework which is generally considered inferior to both. Using both packages takes extra development time and adds extra complexity to the project.
The New Update
The change in the new Oculus Integration release is that its core features now support the SteamVR API, instead of just the Rift’s Oculus API. From a development perspective nothing changes except that these prefabs and APIs will set and return values for a HTC Vive instead of just for a Rift.
The features supported so far are:
- Camera: the OVRCameraRig prefab used to handle the virtual cameras for the user’s eyes and gameobjects for the user’s controllers fully supports the HTC Vive
- Tracking: the API calls to get the velocity or angular velocity of the headset will work for HTC Vive
- Input: the API calls to get the button states, thumbstick positions, and trigger depression of the Touch controllers – for HTC controllers the trackpad is treated like a thumbstick, and the app button (above the trackpad) is treated like the top Y/B buttons on Touch (controls mapped to the A or X button need to be changed)
- Haptics: the same APIs for haptic feedback on Touch now works on HTC controllers
- Guardian/Chaperone: the API to retrieve the user’s Guardian boundary and playspace will for HTC Vive users retrieve the Chaperone boundary and playspace
- Avatars: Oculus Avatars will work on SteamVR, but non-Oculus users will have to select from a predefined list instead of creating their own (this was actually enabled a while ago separately, but ties in)
What This Means- And Doesn’t Mean
UPDATE: we have changed the wording of this section to avoid understating the effort of porting between VR platforms
First off, none of this has any direct user-facing consequences, this is for developers. If a developer creates a game in Unity for the Oculus Rift, then decides to port to HTC Vive, they use Oculus Integration assets & APIs they were already using. There is no longer a need to integrate SteamVR Plugin’s separate prefabs & APIs and manage two versions of everything at once. We should of course note the SteamVR Plugin can also be used to support both headsets, but this can’t be used for Oculus Store builds. Ultimately, this means developers building with SteamVR first and then planning to submit to the Oculus Store eventually would have to use the Oculus Integration anyway.
Oculus Store games still can only have Oculus API support ticked in Unity — this change won’t make the HTC Vive work there. What this does do is lower the technical barriers to Unity developers building for Rift first and then also releasing their apps on SteamVR, or wanting to release on both.
Right now the only alternative platform supported by the Oculus Integration is SteamVR, with the HTC Vive listed as the only supported hardware. This is also just for Unity, not Unreal Engine. Hopefully in the future this support will expand to other platforms, because anything that makes it easier for developers to put their applications on additional hardware or storefronts helps everyone.