Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Native VR Support Best Practise / Project Setup

Discussion in 'VR' started by appymedia, Aug 5, 2019.

  1. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    56
    HI All,

    I'm new to VR with Unity and only dabbled with Unity outside of VR previously and am trying to get started in VR dev. I'm using Unity 2019.2.0f1 and looks the VR template has vanished I saw in there previously, not entirely sure why and can't see any official response on the issue (a few others have asked) so trying to establish what exactly is the best way to setup a project for VR.

    I quite like the idea of using Unity’s native XR feature’s so I don't have to install or count on 3rd party assets. I believe the new Unity input system will / does support XR tracking and input but it’s a bit early still and not a lot of docs and so on to help guide a newbie like me.

    I've installed 2019.1.13f1 to get access to the old VR template so I can see how the XR rig is setup and so on. It uses the XR Legacy Input Helpers package and the Tracked Pose Driver which gets things setup with HMD tracking at the right height via a script.

    I still have to solve general input for triggers, buttons etc but from what I've read I don't think that will be too tricky using the 'old' input system.

    I just wanted to check that this is the current best practise for a VR setup in 2019.2.0f1? Is it Unity’s intention to transition us over onto the new input system and make the XR Legacy Input Helpers package actually legacy, it seems like they are current still?

    Be really good to have an idea about teleporting and general scene interaction in VR as well somewhere although being fair that’s more on me as the dev, still be nice though! I'm guessing I can snoop in on packages like VRTK to get an idea how I might begin.

    Would be handy to have all of this in a template that's updated Unity guys so we know exactly where to start. As a newcomer(ish) its a bit confusing and I’m not really sure I’m making the right approach on things, maybe I'm a dense as well lol

    What’s everyone else doing? Cheers all :)

    **EDIT** I found a sticky in the forums https://forum.unity.com/threads/xr-plugins-and-subsystems.693463/ that I'm digesting, lots of things changing and when you haven't experienced everything previously and just jumping in its really confusing :(
     
    Last edited: Aug 5, 2019
  2. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    56
    Ok, so I've read the sticky I cut and paste in my first comment and the plot thickens.

    It seems on top of what I'm already trying to understand regarding using VR the whole way its incorporated into Unity is changing via the XR Management plugin which is in preview in an effort to decouple XR SDK updates etc from engine releases.

    Yet another choice and another cog in a confusing amount of options for a newcomer.

    Still looking for what the recommend and supported way to use VR in Unity 2019.2 from setup of plugins / packages to scene setup, XR rig and controller input?

    I'm looking at Unreal as well and they have a template which gives you their native VR support, drops you into VR with teleporting, object selection etc. Has well commented blueprints and matching docs, the on-boarding experience is great. I'm not comparing engines or starting any flame war (each engine has its strengths / weaknesses from what I understand) but I'd love to have the same sort of experience with Unity if possible to help us newbies get going.
     
    Last edited: Aug 5, 2019
  3. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    56
    Just thought I'd report back on my experiences with a few setups I've tried...

    ** Unity 2019.2.0f1 + LWRP 1.6.1 (LWRP Template) + Oculus Integration 1.39

    - Needed to switch to single pass stereo rendering otherwise you have only left eye rendering both left and right and right eye is blank
    - Needed to enter 'fake' 999999 ID's in Avatar - Oculus Rift App ID & Go / Quest ID so see hands / controllers
    - Hand / controller models are still pink after using 'upgrade project materials to LWRP materials'
    - Teleporting doesn't seem to work correctly and you fall through floor in the locomotion demo scene

    ** Unity 2019.2.0f1 + LWRP 1.6.1 (LWRP Template) + Oculus Integration 1.38

    - Needed to switch to single pass stereo rendering otherwise you have only left eye rendering both left and right and right eye is blank
    - Needed to enter 'fake' 999999 ID's in Avartar - Oculus Rift App ID & Go / Quest ID so see hands / controllers
    - Hand / controller models are still pink after using 'upgrade project materials to LWRP materials'
    - Teleporting doesn't seem to work correctly and you fall through floor in the locomotion demo scene

    ** Unity 2019.1.13f1 + LWRP 1.6.1 (VR Preview Template) + Oculus Integration 1.39

    - Needed to enter 'fake' 999999 ID's in Avartar - Oculus Rift App ID & Go / Quest ID so see hands / controllers
    - Hand / controller models are still pink after using 'upgrade project materials to LWRP materials'
    - Teleporting doesn't seem to work correctly and you fall through floor in the locomotion demo scene

    ** Unity 2019.1.13f1 + 'Old' 3D Renderer + Oculus Integration 1.38

    - Teleporting doesn't seem to work correctly and you fall through floor in the locomotion demo scene

    ** Unity 2018.4.5f1 (recommended by Oculus) + 'Old' 3D Renderer + Oculus Integration 1.39

    - Teleporting doesn't seem to work correctly and you fall through floor in the locomotion demo scene
    - Needed to enter 'fake' 999999 ID's in Avartar - Oculus Rift App ID & Go / Quest ID so see hands / controllers

    I did partially fix the broken teleporting by adjusting the projects fixed time setup to match my devices refresh rate, so in my case Rift S 80hz 1/80 = 0.0125 but the teleporting was still not working about 10% of the time and just 'sticking' and when it did work there was a delay that didn't feel right. Obviously the 'pink' rendering could be fixed by opting for the 'old;' Unity renderer but I was just noting what wasn't working well out the box. I thought I'd have a good reference by using the 'offfical' Oculus Integration package but me experieince hasn't been great.

    I can get the built-in native Unity XR working ok via the Tracked Pose Driver and 'think' I have a correct rig setup. I've nicked the height setup script from the now old VR LWRP template but I still have no real reference for how to implement teleporting and grabbing etc. Only other things I can think of are VRTK but I'm not that confident I'll have a good experience there as a quick look at the docs invites me to install the Oculus Integration which I was seeing issues with like above (I only tried the teleporting scene, makes me wonder what other issues I'll run into). Those that are using VRTK what versions of Unity and VRTK are you running with? Is it easy to run with out the box and a decent reference point to help you understand and create your own mechanics?

    Maybe I'm doing something wrong? Ultimately all I''m after is a good reference point with some simple VR mechanics like teleporting / grabbing etc that I'm not battling through to get to the start line? Or is this just the norm?

    Any advice appreciated.