Search Unity

Community VR Template

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

  1. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    I'm thinking about try to put together some form of community VR template based only on Unity's native XR features, no 3rd party assets or SDK's. The idea is it keeps things simpler (in theory) and is forward thinking as Unity continue to grow the XR features built in to it.

    Bear in mind I'm no expert with Unity or VR so would appreciate any help on this, I'll setup a github repo once I have something that might be useful.

    Might be a while but maybe we can solve a few of the issues / best practises ourselves this way?

    ** EDIT I removed my pre-ramble about UE4, not sure it was relevant here and also now I've spent some more time taking a step back and solving the VR issues I had with Unity I'm really enjoying stuff and surpassed where I am with UE4 by quite a margin but thats probably because I already knew Unity to a minor degree.
     
    Last edited: Aug 12, 2019
    mgear likes this.
  2. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    A little update on this. I've setup a project with the following...

    Unity 2019.2.0f1
    LWRP 6.9.1
    Post Processing 2.1.7
    Oculus Desktop 1.38.1
    XR Legacy Input Helpers 2.0.6

    I am using a Oculus Rift S with the Oculus version of the software installed as follows 'Oculus app version 1.39.0.272909 (1.39.0.272909)'

    So far we have...

    XR Rig setup and height set correctly via the old set height script from the 2019.1 VR template.
    Single pass rendering (as multi pass doesn't work and the editor melts down).
    HMD tracking (I just let Unitys built-in XR do that for me without any extra effort).

    Input positional and rotational controller tracking....

    I added the Tracked Pose Driver onto the right hand and that works fine. For the left hand I setup the new XR input system, again seems to be working fine.

    In theory I could remove the dependency on the XR Legacy Input Helpers package but I've read at present the recommended way to track (position and rotation) things like your controllers is via the Tracked Pose Driver as it does an extra sweep at the tracking to minimise lag etc and some other things.

    Buttons and triggers on controllers...

    The trigger and grip from my Oculus Rift S controllers are working via the new XR input system, no problems there, assume the rest of my controls will be fine as well.

    I'd like to have some basic interaction and teleporting working next. Nothing too fancy but enough to understand the concepts so they can be adapted to suit a given project.

    Got to say I enjoyed things once I got going and feels like I'm at least starting to understand where Unity is right now as regards XR. Definitely eager to keep going :)

    Will get the project in a repo of some sort soon. Can't promise the codes the best (or anything is correct for that matter) but its a start.
     
  3. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    Pushed this into a little repo, not sure if its any use to anyone but is shows what I wrote above, the code has 0 error checking etc but you can see how to go about collecting input from the new XR Input system (for the left hand), right uses TPD. I used this doc as a ref...

    https://docs.unity3d.com/Manual/xr_input.html

    You can see I'm also changing the material colour of the cube being tracked by the left controller so I could get some visual feedback.

    https://github.com/appymedia/Unity-LWRP-VR-Template
     
  4. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95