cancel
Showing results for 
Search instead for 
Did you mean: 

Recommended upgrade path for Unity projects with 0.7.0.0?

gstercken
Honored Guest
I have a few questions regarding Unity 5.1's built-in VR support, and the Oculus Runtime / SDK 0.7.0.0.

Please correct me if I'm wrong, but just to recap:

In the "old days" (Unity up to 4.x, Oculus Runtime up to 0.6.x) we would use either the OVRCameraRig or the OVRPlayerController (which makes use of the OVRCameraRig).

The OVRCameraRig would take care of creating the two separate cameras (using the correct settings for IPD, eye height etc. from the current user profile in the Oculus Configuration Utility). The OVRPlayerController would provide a handy default character controller that could be moved around a virtual world using a game controller, keyboard or mouse. It featured additional useful properties like acceleration, jump force, damping, the OVR Main Menu (very useful for debugging), and placed the OVRCameraRig at the height calculated from the player height setting in the Oculus Configuration Utility.

Now comes Unity 5.1 with built-in VR support, and supposedly makes OVRCameraRig obsolete (by letting a standard Unity camera act as a stereoscopic camera rig). However, up to Oculus Runtime 0.6.x, we could still use OVRCameraRig instead of the built-in VR support, so no changes to existing Unity projects were required. But since 0.7.0.0, this backward compatibility path has been dropped (using OVRCameraRig will raise a runtime error)- so it's time to finally do away with OVRCameraRig, and use Unity's built-in VR support. Correct so far?

This raises the following practical (how-to) questions:

  • How about OVRPlayerController though? Is there a replacement for it? (Couldn't find any documentation about the topic). If not: Are we supposed to roll our own character controller from now on, re-implementing features like acceleration, damping, rotation amount etc.? Or will the old OVRPlayerController still work, as long as we replace its OVRCameraRig with a plain Unity camera? Granted, I guess both could be done with little effort… But what's the recommended upgrade path for existing Unity projects? Any documentation/suggestions about that?

  • Same with the old OVR Main menu (the one you could easily display, by default, with the space bar): It's part of the OVRCharacterController, which is now obsolete. So What's the recommended course of action? Keep using a modified OVRCharaterController, build our own, or is there any replacement that I've simply overlooked so far?

  • When using our own character controller, how can we make sure the camera is placed at the correct height (assuming we still want to respect the player height setting from the control panel)?


But aside from those more practical questions, I was also wondering about the following (more technical, or "how-does-it-work") question:

From what I understand, the placement, angle, FOV and projection matrices of the two cameras in the stereoscopic rig need to be carefully adjusted and tailored to the actual HMD: Lens geometry, lens-eye-distance, lens-screen-distance etc. all come into play. Additionally, the lens-eye-distance is variable with the Rift, and can also be set in the control panel. So I was wondering how Unity's generic VR support deals with those factors? Are they explicitly targeting only the Rift (DK2) for now, and have the access to those parameters hard-coded? Or is there an API that lets them retrieve those parameters based on the connected HMD, so it would also dynamically adapt to, say, CV1, Gear VR, or HTC Vive? Same goes for additional parameters like IPD, player height, A/B-cups etc. that are, for now, Rift-specific, set in the control panel, and have been handled in the past by the Oculus-specific Unity plugins. How does Unity 5.1 deal with these in a generic manner?

It would be very helpful if someone could shine some light on the practical questions, and interesting if someone knows the answer to the technical question. Again, it's entirely possible that those are already covered somewhere in the Oculus SDK or Unity documentation, and I just totally overlooked it - if so, please point me in the right direction.

Thanks in advance!
2 REPLIES 2

vrdaveb
Oculus Staff
"gstercken" wrote:
Now comes Unity 5.1 with built-in VR support, and supposedly makes OVRCameraRig obsolete

Today there are 2 ways to make VR apps for the Rift and Gear VR: (1) with our 0.6.1 Unity 4 Integration and (2) with Unity 5.1's built-in VR support. Unity 4 is basically on life support and we encourage you to use Unity 5.1. Although it's possible to make VR apps without any special scripts or prefabs there, we have updated versions of everything in the old Integration package to use Unity 5.1's built-in VR. The new assets are in the new Utilities package, available here: https://developer.oculus.com/downloads/game-engines/0.1.0-beta/Oculus_Utilities_for_Unity_5/.

OVRMainMenu has been replaced by two separate scripts: OVRDebugInfo, which shows the same kind of menu in proper 3D using the new uGUI system, and OVRSceneSampleController, which does the app-specific scene transitions and button handling.

OVRPlayerController is still in the utilities and it can still use the user profile to set the OVRCameraRig's height.

There are some minor changes in the way the Utilities work as compared to the Integration. Be sure to read the new online documentation: https://developer.oculus.com/documentation/game-engines/latest/concepts/book-game-engines/.

gstercken
Honored Guest
"vrdaveb" wrote:
Although it's possible to make VR apps without any special scripts or prefabs there, we have updated versions of everything in the old Integration package to use Unity 5.1's built-in VR. The new assets are in the new Utilities package, available here: https://developer.oculus.com/downloads/game-engines/0.1.0-beta/Oculus_Utilities_for_Unity_5/.
Thanks - that's exactly the information I was missing! I hadn't come across the new Utilities packages yet, or read anywhere about them so far. 🙂

"vrdaveb" wrote:
OVRMainMenu has been replaced by two separate scripts: OVRDebugInfo, which shows the same kind of menu in proper 3D using the new uGUI system, and OVRSceneSampleController, which does the app-specific scene transitions and button handling.

OVRPlayerController is still in the utilities and it can still use the user profile to set the OVRCameraRig's height.
Cool, great news, in both cases. Thanks again!