Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Single Pass Rendering on Daydream?

Discussion in 'Daydream' started by Claytonious, Oct 9, 2017.

  1. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    With 2017.2f2 and 2017.3b3, it appears that we are *not* getting single pass rendering on a Google Pixel XL, judging by the frame debugger (which shows ALL of our draw calls once for each camera, for a total of almost exactly twice the number we see in editor). Should we expect that to be closer to 1:1 if single pass rendering were working?

    The option is selected in Player Settings under XR (Stereo Rendering Method set to "Single Pass (preview)").

    Is single pass rendering supposed to work on Daydream at this time? If so, are there things we might be doing in our setup that are preventing it from working?

    Thanks!

    Edit: Our number of SetPass calls is also doubled when running on device.
     
    Last edited: Oct 9, 2017
  2. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    It sounds like this is supported and apparently working for most folks, so I must be wrong to hope that SetPass and Draw calls would be reduced by single pass rendering?
     
  3. scottb

    scottb

    Unity Technologies

    Joined:
    Jan 26, 2016
    Posts:
    13
    It depends on whether or not you are using Android 8.0. Google has disabled it for Android 7.x on Pixel, because of graphics driver bugs.
     
  4. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    This is on a device with oreo. Should I be expecting double setpass and draw calls when single pass rendering is off? Or is there no correlation here?
     
  5. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    Hmm, here is default Unity scene, with one cube, Daydream /single pass enabled (Google Pixel, Android 8.0)

    5.6.1f1
    upload_2017-10-10_15-4-3.png

    2017.1.1p4

    upload_2017-10-10_15-15-11.png

    So I guess it just stopped working at some in 2017.x? But, surely, such a thing would be a known issue by now?
     
    Claytonious likes this.
  6. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    Submitted a report using 2017.3.0b3

    Wondering if I should have stayed on 5.6.x. I only upgraded because I was forced to due to the close button bug. I think they actually fixed it in 5.6.3 though.. I might downgrade o_O
     
    Claytonious likes this.
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    @jmitcheson : that is a brilliantly simple experiment to run. Thank you for doing it. What's the bug number that you reported so I can watch it?
     
  8. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    I'll post it when it comes through. It's still uploading and even then I think you only get a bug # once Unity responds.

    BTW as an indirect result of you making this thread, I've realised that the close button bug I was talking about was actually fixed in 5.6.0 and my app store rejection was due to not having the required script on all my scenes. So I've been beta testing 2017.x for nothing *cries*. At least I've learned a few things..
     
  9. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
  10. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    !!!

    I may have found a clue.

    In the 2017.3.0b3 project, when I set "Clear Flags" on the camera to "Solid Color" then frame debugger displays the desired output. When I set it back to "Skybox", the calls are doubled up again. And, like I mentioned, when I open the same project in 5.6.1f3 there is only one call regardless.

    upload_2017-10-10_22-32-13.png
     
    Claytonious likes this.
  11. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Interesting. I tried setting the clear flags to "Solid Color" in 2017.2f2 and it did NOT fix the problem. Still double.
     
  12. kenvink

    kenvink

    Joined:
    Sep 13, 2017
    Posts:
    15
    Thanks guys, in the previous version of Android, I got it working but super unstable.
    I have to start the app in landscape mode otherwise it will just crash.
    So I upgraded to new android and feel that it is way more stable.
    But then I realized that Single Pass Rendering was not there any more.

    The idea to start the app in landscape mode is from here:
    https://github.com/googlevr/gvr-unity-sdk/issues/709
     
  13. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    So does anybody know if there is a way to get single pass rendering to work for Daydream Android 8 devices right now? It sounds like maybe a downgrade to Unity 5.6 would work based on jmitcheson's tests, but I'm loathe to go down that painful road if this is simply a bug that's likely to be fixed soon.
     
  14. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    It's working for me on 2017.3.0b3 on my production project, but I don't use a Skybox at all.

    Try a new project, switch to Android, enable Multithreaded rendering, Daydream, and SP, (don't forget to change the package name) and then run the default Unity scene but set Clear Flags to Solid Color. For me this yields the following result in frame debugger on 2017.2.0f1

    upload_2017-10-11_8-24-57.png

    If that doesn't give you the same results I can send the entire project
     
  15. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    I *can* replicate your findings after all, but only on a new, empty scene with a single sphere in it. Clear flags solid color gives me glorious single pass rendering. Clear flags of sky box gives me bad old double rendering.

    However, when I try to run my *real* scene, I still get double rendering, even when I *do* set clear flags to solid color. So it is not as simple as only the clear flags on the main camera - there is some complex stew of variables here that is causing single pass rendering to not work with non-trivial scenes.

    I am going to keep pounding through variables - maybe disabling parts of my scene 50% at a time until I can also make that real scene use single pass, then slowly turn things back on until I find the culprit(s). Given the long build times, this is super time intensive unfortunately. I'm a sad panda.

    Edit: this was with 2017.2.f1.
     
  16. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Your log2 search of the variable space is optimal, if not still painful.

    A sanity check for myself, and generally just trying to help map this problem:

    I notice 2017.2.f1 is bundled with OVRPlugin version 1.14.1
    But the plugin in the latest github is 1.18.1

    We can choose which to use using menus:
    Unity/Tools/Oculus/DisableOvrUtilitiesPlugin. { use unity bundled }
    Unity/Tools/Oculus/UpdateOvrUtilitiesPlugin. { use imported }

    We need to get headers from github to actually use the plugin, but the plugin itself; are you guys hooking into 1.14.1 or
    1.18.1?

    Also I saw SP rendering not working at all (black screen) on Galaxy S8 unless I had at least 2xMSAA enabled. I already had clear cam to solid color set.
     
    Last edited: Oct 10, 2017
  17. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    @SiliconDroid - so you're talking about similar issues on GearVR, then? We're working through this on Daydream at the moment, but there may be some useful overlap. In particular, I've not tried any changes to MSAA settings so far, but will try that after I finish isolating the cause of single pass not working between an empty scene and a real one.
     
  18. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    RE SP and MSAA: I'm talking about daydream on S8. It took ages for me to get SP working, 2xMSAA did the trick, but still I have jittery tracking when hovering around submit at 60Hz, asynch reprojection glitching but that's a samsung driver issue it seems.

    Forgive my mixup by mentioning OVRPlugin for the bulk of my post: brain mixup, I'm trying to get both daydream and GearVR going smooth (both on one project instance) and I have bad head cold with congestion, I also just tried to start my GearVR with my daydream controller, only realizing after WAY too long. Note to self: don't refactor any code right now.

    Well I'll keep my eye on your findings, It feels like all mobile VR is going through a wooly patch right now, with various platform/device combos being less stable than 5.x versions.
     
    Last edited: Oct 11, 2017
  19. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    Yeah that's no fun. You have tried with the "cube scene" but inside your own project, now? Because that will tell you if it's your project settings or your scene. It could be a combination of both.

    I have dynamic batching and GPU skinning off, if that helps. And 2xMSAA
     
  20. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Well, I stripped things out in chunks, build after build, until I was down to a nearly empty scene with only one model, a gvr laser pointer and the gvrcontroller prefab in it. When I finally removed only the gvr controller and the laser pointer, it became single pass again. So I thought those must be the culprits.

    So I reset from version control, removed only those from the scene, built to device, and ... it's not single pass. FML.

    I might try one more time. But at this point, downgrading to 5.6 might be the only good answer.
     
  21. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Yes, I get single pass with an empty, default new scene, clear flags set to solid color, and only a sphere in it. But not single pass on our real scene, even with camera set to solid color.
     
  22. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    @Claytonious
    I should have asked earlier:

    what version of GoogleVR are you using?
    I imported GoogleVRForUnity_1-7.unitypackage
    But I only selected scripts folder.
    I am using the plugin bundled with unity 2017.2.f1

    P.S.
    I'm not suggesting this is any solution, I still have issue with render texture not filling necessary screen width, giving a slight crosseyed feel. Just swapping notes.

    EDIT: Render texture not wide enough in daydream solved: had OVR cam rig instantiated and then swapped out for daydream at runtime. Best to have vanilla unity cam up in games first scene. Then can swap out for any VR_SDK specific cam with any associated prefabs during init.
     
    Last edited: Oct 11, 2017
  23. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    This was GoogleVR 1.70.0 from Google's github page. It's the whole enchilada - prefabs and all, not just scripts. Glad you found the problem with the render texture, @SiliconDroid !
     
  24. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Well, no joy with Unity 5.6.3.p4 either:

     
  25. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    Instant Preview prefab switched off? I noticed when I upgraded to 1.7 it seems to hang around in the scene even on the device.
     
  26. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    And also is the frame debugger definitely connected to the remote player at that time? I know sometimes I have seen it flip back to the editor by itself and I didn't notice.
     
  27. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Yes - the editor never renders these things twice. And no instant preview prefab present at all.
     
  28. robs_unity

    robs_unity

    Unity Technologies

    Joined:
    Sep 26, 2016
    Posts:
    6
    Claytonious and SiliconDroid like this.
  29. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Well thank you so much for the update @robs_unity - that made my day! Just knowing I'm not insane is helpful, but more importantly, it's great to hear that a fix is probably on the way for planning purposes. Please keep us all updated on any news that develops and if there's any workaround that we can do from the game side we would be happy to give it a try. Also happy to provide any more information that's needed in order to help you guys diagnose and fix the problem.
     
  30. scottb

    scottb

    Unity Technologies

    Joined:
    Jan 26, 2016
    Posts:
    13
    Google has disabled single-pass support on the Pixel 1 in both Android 7.x and 8.0. They said it should be re-enabled in the first 8.0 update.
     
    Claytonious likes this.
  31. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    !!!!!!!!!!

    Thank you deeply for the explanation of what happened here @scottb. If you had not found this and shared it with us on this forum, none of us would ever have known why our games suddenly slowed down or what to say to our customers who have bought them. I would be dreading another day of testing wild guesses instead of building new features.

    I can't imagine why Google would do this without any warning to developers. Their behavior with respect to the daydream market and its developers has been... perplexing. But I'll resist the urge to rant here where it would do no good.

    Heroic of you to find out and let us know, though - thanks again!
     
  32. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
     
  33. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    Does this come out somewhere in the logs?! How are we supposed to know? o_O
     
    Claytonious likes this.
  34. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    Has anybody become aware of any change or roadmap with respect to having single pass on Daydream work again?

    Thanks!
     
  35. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Hoping for new information as well!
     
  36. kenvink

    kenvink

    Joined:
    Sep 13, 2017
    Posts:
    15
    FYI, we tested and SPR works on Pixel 2. But you know, Pixel 2 has its own problem with its screen.
    But that is for another topic.
     
  37. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,897
    I see the warning below XR settings, but the question is how can we detect at runtime if current device supports Single Pass Stereo or not?

     
  38. kenvink

    kenvink

    Joined:
    Sep 13, 2017
    Posts:
    15
    Good news, this is fixed in Android 8.1.0
     
  39. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,897
    So no luck for Android 7 devices?
     
  40. jmitcheson

    jmitcheson

    Joined:
    Oct 21, 2016
    Posts:
    96
    I'm still confused on how we actually detect whether or not SPSR is enabled.

    Can anyone comment?
     
  41. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,897
    This thread should help although I have not found a reliable way yet.
     
  42. kenvink

    kenvink

    Joined:
    Sep 13, 2017
    Posts:
    15
    Run the app on the device, plug in usb cable and use Unity one frame debugger to view number of draw call. If you see 2 set of exactly same number of draw calls then SPR is off, otherwise the number of draw calls should be cut in half.
     
    Kronnect likes this.