Search Unity

Positional Tracking in unity

Discussion in 'AR/VR (XR) Discussion' started by BokuDev, Nov 2, 2015.

  1. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81
    TLDR: Download my Camera test tech demo and let me know if your ok with the Camera in the Dream Knights.
    Download: https://drive.google.com/file/d/0B-vzmuumvkewM3BEdXRFQ2FMTkk/view?usp=sharing




    Unity VR's integration problems with the DK2 positional tracking:
    So this may seem like a angry letter to Oculus and Unity about the VR implementation for the DK2 but its not. Simply just a report of my issues with it, and how it can be fixed pretty simply. Do keep in mind this review of the integration's are used with the latest versions of both Unity and the Oculus Runtime/ other Oculus downloads.

    (Unity's integration with the Oculus Rift DK1):
    Unity's integration for VR with the DK1 was perfect for that tech right, you could simply place a camera in a scene and rotate your head and everything was set up, ready to go and that worked well for dream knights because setting a camera in a scene was as easy as placing one down and letting the player look around the scene (even without the body/leaning tracking of a DK2 camera). There was still the chance for motion sickness because the player would lean forward and of course this wouldn't translate into the game at all.



    (Unity's integration with the Oculus Rift DK2):
    Unity's integration is much the same as the DK1 just place a camera in the scene or child it under an object if you want it to move etc. The only issue is that you can play games on the oculus share or oculus demos and notice great positional tracking. When you start a normal scene place a camera down and maybe even a cube you see this:

    https://embed.gyazo.com/8615e8da9cb4a58 ... b45a20.mp4

    little to no positional tracking. It mainly feels like using a DK1. In that MP4 I am moving very far back (to the back of my room) and no visible change is happening).

    The way around this for developers is two options. One is to scale the world to the size of ants making everything and I mean everything in your scene super tiny like 0.0001 sizes. You can do this by making a game object and parenting EVERYTHING in your scene to that object and just using the scale tool until you get a feeling of moving your body with positional tracking that feels like its actually happening. The smaller you make the scene the more sense of positional tracking you may get. There are LOTS of issues with making your world that small. A lot of them stem from coding issues like collision detection or the Unity editor camera having difficulty on working on the scenes because the scale (moving your editor camera around when you need to level design may look faster because of the smaller size of the world). All in all its a pretty move varrying on what kinda game you are making. Keep in mind its not even documented that this is how you get more natural positional tracking with the DK2. Its just a known thing by a lot of developers so far.


    The second way (I like to argue the better way) is to make a empty gameobject/name it/tag it (Camera Scaler) and change the scale with the scale tool of that Camera Scaler object to change the camera making it bigger. Once you have done that your world size doesn't matter and you get pretty good tracking and a near perfect drag and drop camera if you make it a prefab afterwords so you can just place this new scaled camera in any new scene you want after. The issues that this gives is a tiny bit of rotational tracking gets more sensitive when you rotate your head right or left leaving some users (or at least one of my friends that tried Dream Knights) to feel un-easy. Another issue this can give is broken shadows. Below is what my bigger scaled camera solution looks like in MP4 form.

    https://embed.gyazo.com/7a9b4b1135f2ea7 ... c75cc2.mp4

    So to recap

    Default Unity VR camera:
    https://embed.gyazo.com/7a9b4b1135f2ea7 ... c75cc2.mp4

    My larger scaled Unity VR Camera solution:
    https://embed.gyazo.com/8615e8da9cb4a58 ... b45a20.mp4

    Come on unity staff! ;)
    Both have their issues right now like I stated above and it shouldn't be this way. Sadly I will continue development with my scaled VR camera solution so to make sure that its not totally an evil solution (I don't want to make people sick at all) I want to provide anyone here who keeps up with the development of Dream Knights VR a camera tech demo scene to test the camera. (Please have a DK2)
     
    EoinTrainor11 likes this.