Search Unity

Some Quest-ions

Discussion in 'AR/VR (XR) Discussion' started by hippocoder, Oct 3, 2019.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The Quest is fab. I find myself needing to support this part of Unity and get some energy going. Unbelievable stuff!

    So the quick questions:
    • Quickest way to get Unity content on quest? Wifi APK deployment? Upcoming cable? Tips please!
    • Dev do's and don'ts for Quest specific content?
    • Any major tools from Unity I could've missed being a first timer?

      Thanks all <3
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Use the cable with Build & Run. Works a treat.

    My only other advice is, don't feel you need to use all the Oculus components and objects. For the most part, it's way more complicated than it needs to be (and half of it is buggy too). You're a very competent Unity dev, so I think you'll do well to start with just a camera in a scene standing over a plane. Build & run, and boom, you're looking around in VR. Build your way up from there step by step.
     
    MrEastwood, ROBYER1 and hippocoder like this.
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Brilliant thank you! So just use the supplied power cable and connect to PC USB port. I don't have the correct port so I'll buy a different cable or adaptor I suppose!

    Great. So really surprised about the Ctrl+B. I guess I need to set up an application or something first on the Oculus side then should be sailing?
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    It really is that easy. All you have to do on the Quest side is put your device in developer mode (google will tell you how).

    And yeah, I had to buy a USB-C or whatever it is adapter cable (got mine for a few bucks at Best Buy). But then yes, you just plug that into the power port on your headset and off you go. Get a cable long enough that you can put your headset on without disconnecting the cable from your computer; this will save you a lot of time in testing.
     
    hippocoder likes this.
  5. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    Cable with ADB is definitely the easiest deployment option.

    DO:
    Use stylized art assets, the display is nicer than the Go but you will still lose detail.
    Use the lightweight/universal render pipeline for perfomance.
    Use OVR or Unity's new XR input. The legacy stuff is a bit of a chore.

    DON'T:
    Use HDR. Due to the binned rendering architecture it doubles the workload of the GPU.
    Go crazy with transparency, (layered transparency and overdraw is especially painful).
    Neglect memory, 11MB of cache and ~2.75GB of available shared memory can be tight.

    Here are some great resources for optimizing mobile VR:
    https://developer.oculus.com/docume...ncepts/quest-draw-call-analysis/?locale=en_US
    and


    Unity 2019.3 is supposed to have some new VR integrations like native Unity UI. Might be worth checking out the beta if that interests you.
     
    hippocoder and JoeStrout like this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Excellent, thanks for the advice. I am enjoying Quest dev very much. I have decided to specialise in VR development. Would love to speak to Oculus.
     
    Incode likes this.
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Good luck with that. Since the Quest came out (actually, slightly before), Oculus has gotten very difficult to work with. They don't care about indie devs much. I used to be a huge Oculus fan, and I still dig their tech, but as a company, well... maybe you'll have better luck than me.
     
  8. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    I think their attention is probably just split in too many directions. On my last project we had a large tech client that was partnering with a large entertainment franchise, both billion dollar companies, and there were still some communication issues with Oculus.
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'll be fine talking to them since a hippo is not worth ignoring :p
     
    Incode and JoeStrout like this.
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    All is going well with the old oculus stuff but Unity's new XR stuff fails to get floor height sorted for some reason... And I'm not supposed to use the XRNode stuff according to dev comments so I'm just stuck manually adjusting stuff to get correct floor height, seems a bit odd!
     
  11. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    OVR handles that stuff pretty easily, though parts of OVR are definitely a pain with Unity. Using the XR api, you should be able to get the device's TrackingOriginMode and TrackingSpaceType, as well as the devicePosition relative to the origin mode. From there you can calculate your desired offset based on whether the user is stationary or room scale.

    It's definitely cumbersome compared to OVR, but I suppose it does give a little more control over how to handle all possible states.
     
    hippocoder likes this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thank you!

    Sorry to be a bother but can you give a hint how I should be using TrackingOriginMode - having trouble with that.

    It's really confusing why it doesn't just work. I have a char controller going and expected that the camera inside would simply treat local 0,0,0 as floor - so if I put the controller down on the floor, it would be at my feet. Instead it's either above or below ground, depending on the headset's starting height when it is run.

    (char controller is offset so base is at feet)

    Any tips would be really helpful. I am going to play with devicePosition next, though that's confusing too!
     
  13. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    No problem at all.

    TrackingOriginMode let's you determine the origin of the relative position reported by devicePosition. If the TrackingOriginMode is Floor (usually the case in roomscale mode) the floor should be at world origin (0, 0, 0). If yours is changing between sessions, my guess is that you might be using a stationary guardian, in which case your TrackingOriginMode would be device. This puts your world origin relative to some previous moment in time, usually a display recenter event.

    You can try to force the device to use roomscale by calling SetTrackingSpaceType(TrackingSpaceType.RoomScale), and if your guardian is set up for roomscale, it should use the floor as world origin.

    If you want to handle both stationary and roomscale experiences (sitting and standing for example), you would have to do some additional calculations to fully calculate height involving estimating or asking for the player's height.
     
    Last edited: Oct 10, 2019
    JoeStrout and hippocoder like this.
  14. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    @hippocoder oh man I feel your pain. I made a really simple VR sandbox to play with some of Unity's XR stuff. Part of that was I copied out a script from the now missing VR template they used to have. You can see the code here..

    https://github.com/appymedia/Unity-.../Scripts/VRSpecific/SetCorrectCameraHeight.cs

    That manages the height for you and sets tracking space etc, worked for me on Rift S at the time.

    If you grab the project you can also see how I setup an XR rig etc as well and I'd just started to implement some really basic locomotion, no idea if thats the best or 'right' way.

    I've since changed over to a Quest as I had just purchased the Rift S and was able to return it as I thought with the upcoming Oculus Link and confirmation Unity and Unreal will support the play preview type thing we get the best of both worlds.

    After finishing my first VR project in Unity I'm playing with Unreal again right now to see which is the lesser evil so I've not tried my template with Quest just so your aware :p
     
    hippocoder likes this.
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hahaha! I will give that a try! Quest is Best.
     
    appymedia likes this.
  16. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    Unreal went pretty well, they have a solid setup to be fair, things just work but can't beat Unity's productiveness - BP's didn't feel as fun as they looked vs C# code :D

    Going to have to roll up the sleeves and battle through with Unity and wait for the Unity cavalry to come and resolve a few pressing things, hoping for that sooner rather then later!
     
    hippocoder likes this.
  17. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    There are some genuine outstanding issues with UniversalRP, I would not recommend anyone use it for Quest/Go development just yet. See this information coming straight from the Unity Devs here too:

    Screenshot_2019-10-02-23-28-39-065_com.google.android.youtube.jpg
     
    appymedia and hippocoder like this.
  18. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    If you have a look into the Oculus scripts provided in the Oculus Integration package, there are some bits of code unfinished, some bits broken/buggy and lots of parts of code where they have commented 'to fix later' or 'it should be using this XR API but we must support Unity 5.x.x' and similar. I would strongly encourage like Joe said just start simple using Unity XR Legacy Input helpers with tracked pose drivers and get a simple rig going.

    I started looking at how the OVR Player controllers were written and very quickly was able to make my own version that was nowhere near as buggy and also more bespoke to the kind of app I am working on. If you need any tips feel free to drop me a message.
     
    appymedia likes this.
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    From what I see we need to wait for the Universal Render Pipeline team to code it.

    MSAA
    FFR
    Vulkan
    Single pass (multiview is still slower I guess, until vulkan)

    So that's a huge amount of work. But Quest is the hottest selling VR unit, and it's accelerating, looks like it will actually go past fb's projection of 1.2m devices per year. I guess VR+Mobile (Adreno) will need a lot of TLC / priority put behind it as it taxes the problems everyone is facing.

    Any ETA on the XR graphics slide? I want to do some serious dev. Thanks!

    I know this isn't productive but... REALLY surprised this isn't sorted out. Does Unity have a tiny team on this or something??? If so, that's confusing isn't it.
     
  20. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    No ETA from them but I was there at Unite Copenhagen asking everyone I could about it just to make the issues clear to people in the teams. It seems they know about it themselves.
     
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah just confused since everyone's had a few years to look at Vulkan.
     
  22. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    Did you find grabbing the Oculus integration for the stuff that's missing like FFR combined with using the new Unity XR input system worked out ok? I started to write my own teleport system and interactions and its I found it better as you can just fine tune things to suit what your doing without fighting another system or setup.

    Right now I'm thinking the 'old' built-in forward renderer + latest Unity stable + Oculus integration (to get access to FFR and platform features) is the safest most trodden path?
     
    hippocoder likes this.
  23. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    Its just my guy feeling on this but when I look at what they are doing right now as a whole with DOTS and the SRP's I'm guessing VR just got pushed to the back of the queue, or is being held up by other things needing to be in-place and stuff.

    What I'd like from Unity is just better guidance in the meantime whilst they get it all in order. Maybe a central place to get an up-to-date view on things, info tucked away in slides like @ROBYER1 posted and forums posts makes it really hard to work out whats going on and are often not up-to-date.
     
    hippocoder likes this.
  24. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Hit the nail on the head there, my project is in two versions, one for UniversalRP and one for Built-In renderer until all the UniversalRP issues are fixed.

    For activating FFR, that only *really* works with Built-in officially for now, FFR is broken on UniversalRP (but there is a hacky fix). To activate FFR, all you actually need is the OVRPlugin.dll, anything it is also dependant on and a script using this code

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using System;
    5.  
    6.  
    7. public class OculusFoveatedRendering : MonoBehaviour
    8. {
    9.     void Start()
    10.     {
    11. #if UNITY_ANDROID
    12.         OVRPlugin.fixedFoveatedRenderingLevel = OVRPlugin.FixedFoveatedRenderingLevel.HighTop;
    13. #endif
    14.     }
    15.  
    16. }
    17.  
     
    hippocoder and appymedia like this.
  25. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    Perfect! Think I know the best way forward for now and I can stop fighting the new things whilst learning as well. When the dust settles with URP I'll look forward to moving across.

    Slight detour... my knowledge isn't great when it comes to rendering tech. I wanted to try URP because I believe its slightly more performant than the built-in renderer and I really like the idea of the shader graph. Does anyone know what else it might bring that would be useful in mobile VR or VR in general?
     
    hippocoder likes this.
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723

    (Everything Unity will have to do in order to get URP up to scratch - love the optimisations used with subpasses to avoid costly resolves)

    Looks to me URP has a long way to go before it'll actually beat builtin for performance since we probably need Vulkan and FFR to really make URP shine. Only way to be sure is test it, but don't forget to use mobile shaders.

    If any Unity staff read this, I'm staying on URP so I'll certainly highlight any problems for this combo. I am also staying on XR rather than external API's so I'll be a useful pest I hope.
     
    appymedia likes this.
  27. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    I actually haven't had very many problems with the LWRP and Quest in VR (I'm in 2019.2) as long as I'm using the right settings, although it does probably take more time to build to the Quest in the LWRP because the shaders seem to take a while (haven't tried it in the old pipeline). I did manage to get Post Processing to work and everything looks pretty good and runs around 72 FPS with 120k-ish tris in the scene.

    I use a Rift to develop everything and then test regularly on the Quest -- at work I often need to show player experiences on a monitor as they happen, so the Quest won't be sufficient until it links to the computer. Using the Rift also streamlines my process a lot since I no longer need to wait for things to build to test them.

    I have barely touched the Unity XR stuff, I've been sticking with the OVR integration. Half of the OVR stuff is broken, especially in the LWRP, but I can usually get it working pretty quickly if I grab something from a sample scene and mess with it for a few minutes.

    My biggest surprise with the Quest was the 'walled garden' thing, which seems fairly brutal for indie devs once I started looking at it -- you can't put anything on the store until you're approved, and you need to get approved as early in the development process as possible. Have you had a chance to look at SideQuest yet? It's a pretty convenient way for players to download games that didn't make it into the Quest store, and it's also got a nice interface for making sure the Quest is connected to the computer, installing apps from outside Unity, etc. https://sidequestvr.com
     
    Last edited: Oct 16, 2019
    ROBYER1 likes this.
  28. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    Could you point me to this estimate? I wasn't able to find it on the Oculus site.

    URP has a bit of catching up to do, but I'd second that it is totally viable in its current state. We're currently hitting framerate in a fairly GPU heavy scene, and we still have optimizations to implement.
     
    Last edited: Oct 16, 2019
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yep but it's not on par with Vulkan + FFR etc ... yet. I'm totally hitting targets too, but your targets are lower than they could be because of this.

    I mean, I was doing full shadows, custom everything on builtin with PS Vita, and before then my own engines for the original first iphone up, and I have no trouble optimising. But it's to me, still a waste of potential.
     
    ROBYER1 likes this.
  30. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    Now that you mention it, I can't find it either and I suspect I read it from some random user in some Reddit thread -- I'll edit my comment so as not to spread misinformation.
     
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    100k doesn't get you further than a retro 2D title, frankly, if that, for serious devs. So it would be incredibly unlikely.
     
  32. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,749
    Weren't you making some sort of Pixar-esque action adventure @hippocoder ? Are you pivoting to VR?

    Although I have to say, the Quest has a certain allure, I've felt it too.

    But I don't think it's a great time for VR development with Unity with its shiny new toys. The SRPs are in flux and it doesn't seem like reliable VR support is high on the list of priorities. Vulkan has been spotty for a while (at least on Android, we currently have it off for our Android builds).

    Unity is aware, but Unity is also aware that Collaborate sucks, so I don't know what them being aware is worth.

    In any case, if you need to release something on VR now, use built in pipeline and legacy stuff. If you want to stick to "new Unity" stuff, be ready to play the "will these packages play nicely together" game a lot, until things settle down. Also listen to whatever @ROBYER1 has to say, he seems to know his stuff.
     
    ROBYER1 and markjanzen88 like this.
  33. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's 100% secret!
     
    AcidArrow likes this.