Skip to main content
Inspiring
July 7, 2015

Oculus Utilities for Unity 0.1.0 Beta released

We have released the Oculus Utilities for Unity 0.1.0 beta. This package has basically the same API as our legacy Unity integration, but it's built with Unity's new first-party VR support (UnityEngine.VR). If you've been using Unity 5.1 with the new "Virtual Reality Supported" player setting enabled, you may have noticed the camera model and feature set differ from what was in the old integration. The Utilities enable you to update existing apps and also access Oculus features not exposed by Unity itself. Questions and feedback are welcome here.

You can download the Utilities and an updated copy of the SDKExamples from https://developer.oculus.com/downloads/.

Be sure to read the documentation at https://developer.oculus.com/documentation/game-engines/latest/concepts/unity-intro/.
    This topic has been closed for replies.

    80 replies

    Up and Coming
    July 9, 2015
    I see this for acceleration:
    "OVRManager.display.acceleration;"
    Is this actually a low latency access to the accel data? I don't know how to get an internal timestamp for this data either like I use to - is there a way to get the timestamp still?. Also, it seems to only want to be called from the main thread, as I get this error when I tried to poll it in a separate thread:
    "get_isPresent can only be called from the main thread".
    I prefer to get as high resolution as available for the accelerometer, so I currently poll it every 2ms on a separate thread, but it doesn't look like I can any more. Any work around for this?
    Up and Coming
    July 9, 2015
    Disabling head model seems only possible by moving the TrackingSpace object in the opposite direction of the head model's local offsets. Moving CenterEyeAnchor or Left/Right anchor transforms in code doesn't seem to register, and I'm guessing that's because you are enforcing that position internally. Would be nice to be able to do something cleaner in the future, so please let me know if there is a better / cleaner workaround.
    Up and Coming
    July 9, 2015
    Sorry for the newbie post..

    I have a new project and I am using Unity 5.1.1p4 on Windows. I have imported the Oculus utility package and that is all good. I pulled in the OVRPlayerController into the project and placed it over my surface which does have a mesh rigidbody.

    When I hit Play I can look around just fine in VR but I cannot make the player move either with the keyboard or xbox 360 controller.

    In reading the docs I saw something that said:
    The controller will interact properly with a Unity scene, provided that the scene has collision detection assigned to it.

    Does my floor not meet this requirement with a mesh collider in place?

    My settings in the mesh collider are as follows:
    Camera (unchecked)
    Is Trigger (unchecked)
    Material (None (Physics Material)
    Mesh (Object_1) the floor

    Sorry for the newb questions. When I last used the OVRPlayerController back in Unity 4 it just worked. :)
    New Participant
    July 9, 2015
    Hey,
    I converted my Unity4.6 GearVR project to Unity5.1.1p3 Virtual Reality Supported Oculus Utilities 0.1.0 Beta.
    This project was running at 60fps under 4, now with 5 the same project is running at 30fps :/ cpu spends its time waiting for the gpu.

    @vrdaveb, would you be interested in getting a bug report with project files to look into the issue?

    Thanks for any help, can't submit anything right now in that situation.
    Up and Coming
    July 10, 2015
    I did figure this out..

    Turns out that I had somehow messed with the OVRPlayerController in the scene. I put in a fresh one and the box collider worked fine.

    It is really hard sometimes to debug things in Unity.

    Thanks all.


    "MarkM" wrote:
    Sorry for the newbie post..

    I have a new project and I am using Unity 5.1.1p4 on Windows. I have imported the Oculus utility package and that is all good. I pulled in the OVRPlayerController into the project and placed it over my surface which does have a mesh rigidbody.

    When I hit Play I can look around just fine in VR but I cannot make the player move either with the keyboard or xbox 360 controller.

    In reading the docs I saw something that said:
    The controller will interact properly with a Unity scene, provided that the scene has collision detection assigned to it.

    Does my floor not meet this requirement with a mesh collider in place?

    My settings in the mesh collider are as follows:
    Camera (unchecked)
    Is Trigger (unchecked)
    Material (None (Physics Material)
    Mesh (Object_1) the floor

    Sorry for the newb questions. When I last used the OVRPlayerController back in Unity 4 it just worked. :)
    New Participant
    July 10, 2015
    Hi everyone,
    I've been testing every single way to achieve an oculus programm under Unity. I've been testing the performances of each method. So here is a list of my conclusions and problems.

    By the way I'm using Mac OS Yosemite and Unity 5.1.1p3.

    Oculus Utilities :
    - Delete your old OVR Asset
    - Download Oculus Utilities
    - Download the last SDK
    - Enable VR Support
    - Use the integrated Oculus Prefab

    Issues : The framerate is quite low approximately 25fps. The prefab is currently trying to access a Gamepad that I don't have.
    Conclusion : The performances are a bit disappointing. However it's good to have a customizable prefab.

    VR Enabled :
    - Delete your old OVR Asset
    - Download the last SDK
    - Enable VR Support
    - Just drag the new FPS prefab.
    - Built your project
    - Plug your Oculus
    - Your Game is directly launched in your Oculus.

    Issues : There seems to be a problem with the Inputs. My character is moving without following the OVR Mouselook. If someone has a fix... I can't check the performances. Space button is not set to check your framerate.
    Conclusion : Easiest way to use the Oculus under Unity. The framerate looks really good even If I can't check it. You don't have control on your Oculus prefab.
    vrdavebAuthor
    Inspiring
    July 10, 2015
    "Anticleric" wrote:
    It only happens from Chinatown into other scenes, BUT only when I build in an unrated scene.

    We tested switching between complex scenes, but there isn't an obvious reason why this would be happening. It would be great to get a bug report/project to help reproduce this.

    "Anticleric" wrote:
    I'll also try to get some profiler info for you.

    Thanks. Also check out the profiler's new Timeline view. If the VR subsystem is slowing things down, it will probably show up as a bubble at the beginning or end of the frame on the Render Thread there.

    "Anticleric" wrote:
    The lights in the right eye thing is the real priority.

    You are using the new utilities and not the old integration, right? Unity's new built-in VR (which the utilities are based on) doesn't allow you to set a different number of pixel lights per eye. I set up a test scene with 20 lights in deferred mode, but they all showed up in both eyes. I've seen some cases where deferred lighting, linear lighting, and shadows don't play well with RenderTexture.active. Are you setting that?

    "Anticleric" wrote:
    I'm using a controller as the main input.. but fall back to the mouse for quick testing.

    It sounds like you are using Unity's standard FPS controller. That isn't necessarily ideal for VR, but the issue should go away if you make sure the vertical mouse input isn't bound to any of its axes.
    vrdavebAuthor
    Inspiring
    July 10, 2015
    "bteitler" wrote:
    I see this for acceleration:
    "OVRManager.display.acceleration;"
    Is this actually a low latency access to the accel data?

    Right, that is the simplest way to get acceleration. If you want to get it at a higher frequency with a timestamp, consider writing a native plugin and calling ovrHmd_GetTrackingState from it. You will need the ovrHmd handle, which is the IntPtr returned by UnityEngine.VR.VRDevice.GetNativePtr(). If you don't need the timestamp, try copying the code from OVRDisplay.acceleration and removing the VR.VRDevice.isPresent check. Just make sure check it yourself from the main thread before setting up the loop.
    vrdavebAuthor
    Inspiring
    July 10, 2015
    "bteitler" wrote:
    what is the correct way to completely disable head position tracking as well as the head model?

    Normally you would write a function like this:
    	public void UpdateTransform(OVRCameraRig rig)
    {
    rig.trackingSpace.localPosition = -rig.centerEyeAnchor.transform.localPosition;
    }

    and then add it to OVRCameraRig.UpdatedAnchors.
    If that doesn't work, send me a PM.
    Inspiring
    July 10, 2015
    "vrdaveb" wrote:

    You are using the new utilities and not the old integration, right? Unity's new built-in VR (which the utilities are based on) doesn't allow you to set a different number of pixel lights per eye. I set up a test scene with 20 lights in deferred mode, but they all showed up in both eyes. I've seen some cases where deferred lighting, linear lighting, and shadows don't play well with RenderTexture.active. Are you setting that?


    Thanks for the response. I'll look into the rest. It's not crashing in the editor, so I can't get a bug report from Unity.

    I sent you a PM with a build if you want to see the light issue. I'm not setting pixel lights per eye.. just brainstorming.
    100% sure I'm using the new utils. Says so in my crash logs. haha
    Had one other person test it, they couldn't get it to run in direct mode, and had no crashes in extended.

    So confused.
    Might try the new p4 patch from unity and see if that helps.
    IRIS VR - TECHNOLUST - KERSER - BODY/MIND/CHANGE - QUANTUM CAPTURE - OCCUPIED VR