cancel
Showing results for 
Search instead for 
Did you mean: 

Unity 5.1 and the Oculus Integration (Official Info)

cybereality
Grand Champion
Howdy,

A lot of changes are occurring with Unity VR development quickly, so we wanted to be sure to give you a clear heads up about what is happening, when it will happen, and what it means for developers.

= Unity First-Party Support =

Unity 5.1 introduced first-party support for virtual reality, making it easy to substitute a stereoscopic VR camera for your main camera by selecting the "Virtual Reality Supported" check box in Player Settings. The initial release of v 5.1 provides support for the Oculus Rift only.

On June 12, Unity released version 5.1.0p1, adding Gear VR support. All developers wishing to update to Unity v 5.1 should select this release, which is available for download here:
http://unity3d.com/unity/qa/patch-releases

For details on implementing Unity's first-party VR support, see the Unity manual: http://docs.unity3d.com/Manual/VROverview.html.

= Unity 5.1 and the Oculus Integration =

Unity 5.1 first-party VR support is incompatible with legacy versions of the Oculus Unity Integration (versions 0.6.0 and earlier). Projects using legacy versions of the Integration will only work with Unity v 5.1 if the "Virtual Reality Supported" box in Player Settings is not selected. In that case, they should work normally.

Oculus will be shipping an update to our Unity Integration shortly. If you import the new Oculus Integration version into a legacy VR project, it will work normally with Unity 5.1.

Once you update to this version, our Integration will work for the Rift and Gear VR if "Virtual Reality Support" is enabled.

= Known Issues =

Moving to Unity 5.1 is a substantial upgrade for VR development, and we recommend carefully choosing your timeframe for making the update. There is always risk in moving early to a new major release that you may encounter problems related to VR performance or otherwise.

Please let us know about any issues you encounter in the Oculus Unity forums, and keep your eye out for updates.

We are currently aware of the following issues with 5.1:

• All moonlight scripts, including platform UI, CPU/GPU levels, and overlay, are currently incompatible with 5.1.0. Updated versions will come with 0.6.0.1. The following features will no longer work:
• MediaSurface
• TimeWarp sub-stepping (only supports 60, no longer 20 or 30)
• Linear lighting (sRGB) and eye texture MSAA currently don't work. This will be fixed in Unity 5.1.0p2.
• VR.VRSettings.renderScale has no effect on Android.
• There is currently no way to render separate content (stereo video) to each eye. This may come back in a future Unity version.

For release notes and known issues in Unity 5.1:
https://unity3d.com/unity/whats-new/unity-5.1
108 REPLIES 108

zenshin
Explorer
Forcing D3D11 exclusive mode errors

In Oculus Unity Integration v 0.6.0, the C# scripts used "#if UNITY_5_0" in several places. That no longer works with Unity v 5.1 - you must instead use "#if UNITY_5_0 || UNITY_5_1".

The issue is fixed in the 0.6.0.1 package (shipping soon), but legacy users using Unity Integration 0.6.0 or earlier may need to make script changes, if you see errors about forcing D3D11 exclusive mode."

RazTOO
Honored Guest
Thanks for this info Cyber! We did the jump too early on our project. Now rolling back and screwing everything back together with the separate SDK for GearVR as it was before ... 😛

Glad VR is getting more direct support in Unity/UE4 !!!

ridoutb
Protege
What is the recommended method for achieving a scaled down effect similar Lucky's Tale?

Previously, I've changed the IPD or scaled the OVR camera. If I move to the native Unity VR support, will I lose access to these methods?

Is there a best practice for this? Does anyone know what Playful is doing?

drash
Heroic Explorer
So, to restate what I think this post says, we don't *need* the Oculus integration if we're using first-party support, but if we are using the Oculus integration for whatever reason, then we need to have the newest version which has not been released yet. Is that right?

• All moonlight scripts, including platform UI, CPU/GPU levels, and overlay, are currently incompatible with 5.1.0. Updated versions will come with 0.6.0.1.

I'm slightly confused by this statement. Mobile SDK 0.6.0.1 has already been released, I thought? (edit: added ", I thought?" for clarification)

Anonymous
Not applicable
Yes, Mobile SDK 0.6.0.1 is already out.
Original Oculus Unity Package (Oculus 0.6.0.1 and Unity 5.1p1) on Gear VR results in black right eye.
No Original Oculus Unity Package, just raw Unity with Player setting to use VR,using default main camera, simply ends with a crashed Gear VR app on start.

korinVR
Expert Protege
"ridoutb" wrote:
What is the recommended method for achieving a scaled down effect similar Lucky's Tale?

Previously, I've changed the IPD or scaled the OVR camera. If I move to the native Unity VR support, will I lose access to these methods?


I haven't seen Lucky's Tale though, making your camera a child of another game object and scaling the parent game object might work.

Frooxius
Honored Guest
Hello!

I'm happy to finally see the integration, it makes testing much easier from the editor with Direct Mode support and streamlines a lot of things, however I found a significant issue:

The shader receives only the main camera position when rendering each view, which breaks a lot of effects that depend on the view direction. For example parallax mapping or my light-field rendering shader which use the view direction to generate stereoscopic effect look monoscopic.

I have tested this with a simple shader which simply outputs the view direction. With the Unity 5.1 VR support each eye sees the same value, with the OVR plugin each eye sees correct corresponding value.

Additionally other effects that rely on the subtle difference in camera position are broken as well - for example the Water/Mirror reflection which uses a reflection camera are monoscopic as well, since the values they read from the rendering camera are not properly adjusted for each eye as well.

Is this something that could be fixed soon?

-----------------

There are also a few more things that I'd like to suggest:

1) Allow to render a third, widescreen view from the camera just for mirroring purposes on screen, which is especially useful when recording footage or when presenting in public. I understand rendering third view will increase the performance demands, but as optional feature I believe this could be very useful as people who would use it would make sure their machine is powerful enough.
2) Add a checkbox on the Camera component that would allow me to disable/enable VR rendering for that camera quickly. It's not that crucial and I can get the same effect by making it render to a RenderTexture, but I'd find it handy for a few things (like making screenshots).
3) Speaking of screenshots, Application.CaptureScreenshot is broken (outputs odd upside-down image with half black), I think it'd be cool to have this capture screenshot without the VR rendering (16:9).

vrdaveb
Oculus Staff
Thanks for your feedback.

"Frooxius" wrote:
With the Unity 5.1 VR support each eye sees the same value, with the OVR plugin each eye sees correct corresponding value.

At the moment both eyes see all the same _WorldSpaceCameraPos. We're working on a fix. However UNITY_MATRIX_V should be different. Are you able to use that for now?

"Frooxius" wrote:
Allow to render a third, widescreen view from the camera just for mirroring purposes on screen

We get a lot of requests to show different content on the main screen and the Rift. It isn't clear how or if this will be made possible, but you could already take an approach like OVRMirror (http://www.reddit.com/r/oculus/comments/2occwn/ovrmirror_enables_your_apps_can_display_mirror/), which lets you render to a RenderTexture, pass the native pointer to a plugin, and display the texture in your own window.

"Frooxius" wrote:
Add a checkbox on the Camera component that would allow me to disable/enable VR rendering for that camera quickly.

Rather than enabling and disabling VR on a per-camera basis, we currently expose it globally. It can be toggled via VR.VRSettings.enabled (http://docs.unity3d.com/ScriptReference/VR.VRSettings-enabled.html).

"Frooxius" wrote:
Application.CaptureScreenshot is broken (outputs odd upside-down image with half black)

Thanks. Looking into this.

Frooxius
Honored Guest
Thank you for the reply, I'm looking forward to the improvements!

To clarify, I know that VR can be disabled globally, I wanted it on per-camera basis, although it's not something that would be very important to me, just handy sometimes.

The OVR Mirror looks very useful, thanks for that! My idea was to simply use the existing camera, but render three views from it so it could potentially still utilize the performance optimizations - left eye, right eye, "middle" eye for mirroring (plus 16:9 aspect ratio).

Also I forgot another important thing: Would it be possible to add ability to tell which eye is currently rendering and/or define different culling masks per eye? For example for creation of some stereoscopic effects that display different element depending on the eye.

Thanks and keep up the good work! 🙂