Search Unity

Strange XR rendering behaviour on build.

Discussion in 'Daydream' started by BamBamAlicious, Mar 25, 2018.

  1. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
    Hey all, this one has me really stumped.

    The problem started here when I noticed REALLY high amounts of CPU time going to rendering when I build my game. The game easily sits at 500 - 1000 fps on my Surface Pro but struggles with 40 on android.

    https://answers.unity.com/questions...build.html?childToView=1481611#answer-1481611

    To try and narrow down the issue, I've created a basic scene, (a plane, few sprites, couple of cylinders and a couple of cubes). I've noticed that randomly, (normally 2 - 3 minutes), the rendering shoots up in the profiler, and frame debugger shows everything drawing twice per frame.

    doubleRender.png

    The arrowed point in the profiler is the exact moment it happens. I've got both batchings running, gpu skinning, single pass rendering, OpenGL3 forced. Every trick and optimisation I can think of I've done, everything is using a mobile shader and single coloured. No pixel perfect canvases, no rich text. Still the problem doesn't go away! I've also tried downgrading to 2017.1.1f1 and the situation hasn't improved! Im using GVR SDK 1.130.1.

    Any help is appreciated!!!
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    Can you provide the small repro project? We'll try to look and see if there is something we can help with.
     
    BamBamAlicious likes this.
  3. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    And that's the narrowed down sample you were mentioning?
     
  5. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    Dropbox is balking at downloading that project. Can you zip up just the Assets and ProjectSettings folders for the narrowed down repro?
     
  6. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
  7. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    The RAR file ia apparently corrupted. Can you use ZIP instead of RAR and upload again?
     
  8. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
  9. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    Yep, works. Thanks.
     
  10. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
    No worries! Hoping its just a rookie mistake I've made!
     
  11. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    271
    This feels like thermal throttling to me (specifically because you say it only happens after 2-3 minute). Have you tried using https://developers.google.com/vr/develop/unity/perfhud to check?

    What device are you running on? Are you running in 'daydream' or 'cardboard' mode?
     
  12. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
    I'm using the perfhud as well as development built, and it shows throttling from the very beginning, even though the phone is cold. I did think this at first as well, its only recently that I've noticed the duplicate rendering in frame debugger.
    I'm running on a Oneplus 3, rooted to enable running in Daydream mode, can't afford to get a new phone yet!
     
  13. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    271
    ok we'll see if we can repro on a pixel.
     
  14. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
    Brilliant thank you! If it's the same as what I'm seeing here it's a noticeable shift from 6ms on rendering to 10-11ms
     
  15. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
    We've been unable to repro this on our test devices (Samsung S8, Pixel, Pixel 2). This may be an issue specific to this device and the drivers (Android drivers for GFx chipsets are notoriously finicky and bug prone).
     
  16. BamBamAlicious

    BamBamAlicious

    Joined:
    Jan 29, 2017
    Posts:
    58
    Thanks for looking for me! The struggle continues!
     
  17. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    544
  18. evolvingtech

    evolvingtech

    Joined:
    May 27, 2012
    Posts:
    12