Unity 5.1 VR Getting Started

FYI, Docs on the new Unity 5.1 VR support are here:

Recommended Stable Version: 5.1.2p2

Here is the current list of known issues:

  • Oculus 0.6.0.1 runtime is required on Windows, 0.5 on Mac (OSX 10.9+)
  • When upgrading an Oculus / GearVR project from the legacy Oculus Unity Integration Plugin to 5.1 Unity VR, be sure to remove any Oculus plugins from your project to avoid deploy / runtime errors, or replace them with Oculus Utilities for Unity which work with Unity VR.
  • VRSettings.renderScale is non-functional on GearVR
  • UI: Screen Space - Overlay not supported. Recommended to use Screen Space - Camera or World Space. “Scale With Screen Size” is recommended so UI looks the same on Gear VR.

Edit: Another thing to note, make sure you have “Stereoscopic rendering” checkbox unchecked.

Getting Started (Windows)
Here is a bit more detailed quick start guide for getting started with Oculus + Windows development on Unity 5.1. You can review more detailed documentation in the Oculus Developer Docs.

  • Install Oculus Runtime for Windows V0.6.0.1-beta
  • Reboot
  • Open Oculus Configuration Utility from the system tray. Hook up your DK2 (DK1 has some known issues right now, use at your own risk).

    Make sure you have a User listed in the drop down box. If you don’t, click the + button and add one.
  • Click Show Demo Scene and make sure that the demo scene works correctly.

    If you are having issues, you can try changing to Extended Mode in Tools → Rift Display Mode.
    If you are still having issues at this point, please visit the Oculus forums to troubleshoot.
  • Exit the demo scene and close the Oculus Config Utility.
  • Now you are ready to start up Unity, grab the version suggested above, and create a new project.
  • Open menu Edit → Project Settings → Player. Select Other Settings, check the Virtual Reality Supported checkbox.
  • Click Play in the editor. Put on the Rift. You should see a fully head tracked skybox.
  • Build your game!

Getting Started (Mac)
5.1.0p1 onward works with Oculus Runtime 0.5.0.1-beta on Mac (10.9+). It is functional, but there is a tearing issue that we are fixing in a future build (I don’t have a timeline on this yet). We plan to still support mac via 0.5.x runtime, but as Oculus announced, Windows + Gear VR is where Oculus’ primary focus will be for the near future.

Since MacOS does not currently support direct rendering, adjusting your display settings to rotate the Rift’s display by 90 degrees is necessary for the DK2. The display settings are located in System Preferences->Displays.

Getting Started (Gear VR)

  • Be sure that you can deploy a Unity app to your Note4 or S6 (see Getting Started with Android Development)
  • You do not need to install anything extra on your machine to deploy to GearVR.
  • Create an empty project.
  • Switch your build platform to Android. Open menu Edit → Project Settings → Player. Select Other Settings, check the Virtual Reality Supported checkbox.
  • You must include an Oculus signature file in your project.
  • Build and run. Insert the device into your headset and see the skybox with head tracking.

What to do if you’re having problems
If you can’t get the blue oculus demo scene to run on windows / osx, please visit the Oculus forum to troubleshoot the Oculus Runtime.

If you can’t get Unity to work even though the oculus demo scene works, check the Editor and Player logs before submitting a bug with these attached. Alerting us of the case # on the forum here is encouraged so that other users can find details as well.

If you are having an issue with Gear VR, it is most useful to see a full logcat. These can be quite verbose, but editing / filtering them can cut out valuable information.

Feedback
If anything is missing from 5.1 Unity VR that makes it difficult to ship your game, please continue to let us know in this forum. Unity VR will continue to evolve and we want to make it as easy and powerful as possible.

4 Likes
  • Apps that use linear lighting won’t render. Recommended to use gamma for now.

Thanks for the update, is this going to be fixed in the patch? This isnt a trivial setting… thanks!

Fix is currently scheduled for patch 2 which is either next week or the following week.

Great, thanks

I have having issues getting VR mode to work outside the editor with the 0.6.0 runtime.
I’m using a simple bare bones scene of cubes for testing.

In editor everything works fine. VR checked, stereo checked.
hit play and all is good.

I make a 64 bit build, and the app launches in full screen on left monitor in mono.
I try the “-vrmode oculus” and for my app it does nothing.
I tried a friends app who is having the same issue with unity 5.1 and from his I get head tracking working but the display is still the left monitor and still mono.

Oculus runtime drivers are set to direct mode.

Stereo should not be checked when using Oculus Virtual Reality. Your camera will automatically be setup for Stereoscopic rendering even if this option is not turned on. There is a bit of confusion having Virtual Reality supported and Stereoscopic rendering toggles right next to each other, but the Stereoscopic toggle is actually VRDeviceType.Stereo. We are aware that this is causing some confusion and are looking at how to properly address the confusion.

Would help if the 0.6 runtime actually worked

1 Like

My Application crashes on start when i enable antialiasing. Can any one verify that?

p.s. there is probably a reason AA gets disabled in the quality settings when one checks the “Virtual Reality Supported” flag in the PlayerSettings. Whats up with AA, how can i get it now?

p.p.s

A fix for AA is currently scheduled for p2, next week. Updated known issues list above.

Any possibility for setting different rendering masks for left/right eye with the new system? This is needed for stereo video.

1 Like

My application now works with Unitys build in VR support but I have a huge streaking effect.

Even if the Oculus Demo Scene is running good, I get a poor performance with my Unity application.
With Runtime 5.0.1 and Oculus Integration it worked correctly but now its most of the time unplayable.

For me it looks like too little frames or something, but this problem even exist when I run basic scenes.
Maybe my Projectsettings- Time,Quality and Player are adjusted wrong?

I tried this on different PCs (all definitely powerful enough) but the result is stillt the same.

Need definitel help on this topic!

Regards

Great! does anybody have a DK2 first person prefab that works?
I’d be over the moon to get my hands on something better than the botched patch from Unity4

Oh OK got it working fine for me. Just needed to read up a little bit.:slight_smile:
Deleted the OVR packages and just dropped in a first person prefab from standard assets and works like a dream.
tweek the walk speed a bit…

Hi ,Can i do VR head tracking with UnityEngine.VR and Gyroscope sensors?

@thep3000 Does patch1 works for Mac? I see mentioning 0.6 runtime is required. Oculus doesn’t list any downloads for mac. Could you please clarify on making it work on Mac?

Thanks.

To Follow up with Voxel Buster’s question. I am trying out 5.1.1 and can only find a ‘Virtual Reality Supported’ toggle in the Player Settings, but I do not see any VR Settings. Where is the VR Settings. When I press play I get this message

[Compositor] ERROR: Compositor failed to initialize.
And
Bad config or LibOVR not found. VR disabled.

I have Oculus Rift Mobile SDK 0.6.0.1 but am not sure if I need to include the Unity integration package anymore. Please clarify.

Update Added in the LibOVR folder in the removed the error.

Thank you for the new features!. After switching from OVR controller, I have been using the standard FPS controller in my scenes for a while now everything working fine.

However as another poster mentioned I am seeing some performance reduction, a lot of ghosting etc in scenes that previously ran very smoothly, even simple scenes. I don’t have stereoscopic ticked and have run through the entire checklist of do’s and don’ts for a week or so now,so I have 3 things.

  1. IS it possible that if I haven’t updated the standard assets in my build ( eg copied from another unity folder) I could not be getting any of the optimizations mentioned? Is there anything I need to be careful of there?

  2. More of a request but I need to spawn projectiles using a force from the head rotation/position however they currently will only move through the world from the mouse and body position even though parented to the camera and head. I found a work around to add a second FPS controller in the scene and that somehow fixes things, but then framerate is even worse.

3.I would love a checkbox that has head movement affect your walk/run direction as was a previous option in the OVR FPS controller. If you are wondering why, it’s because everything in my game mechanics depend on shooting from your helmet, I am working on making on Part 2 of this game now. https://share.oculus.com/app/tekrok---the-gathering-storm

Thank you for the help.

Is there anything obvious in the profiler? If you can pinpoint a scene that you can share which has a performance regression in Unity 5.1 vs. the plugin oculus integration, please share it via a bug report.

I don’t think so, any standard assets should be fine at this point.

Not sure I follow, but perhaps you should spawn the projectile as a child of the camera so that you get the head rotation / position applied to it, but then immediately remove it so that it is in world space instead of camera space?

We are working on some new standard assets that make their usage in VR easier. We will take this into consideration.

Could you please answer this @thep3000

Patch 1 works with Oculus Runtime 0.5.0.1-beta on Mac (10.9+). It is functional, but there is a tearing issue that we are fixing in a future build (I don’t have a timeline on this yet). We plan to still support mac via 0.5.x runtime, but as Oculus announced, Windows + Gear VR is where Oculus’ primary focus will be for the near future.