Search Unity

Heavy load for Device.present in a GUI

Discussion in 'Android' started by thibautvdumont, Oct 9, 2015.

  1. thibautvdumont

    thibautvdumont

    Joined:
    Oct 6, 2015
    Posts:
    25
    Hello everyone,

    We have been experiencing a critical issue with the menu of our game (GUI on one canvas with various image elements and some animations). While we get quite fair performance on PC, the menu (and only the menu, not the 3D game) is laggy on android devices.



    Looking at the profiler, device.present is taking 60ms and 80% of the total load of our application, dropping the framerate to 15fps. However this item does not appear in the profiler for the PC platform. We have been reading topics on the subject, including modifying VSync flag, looking for eventual outline around our images, etc. but nothing did work. We have no camera in our scene (the canvas is set on Overlay) and images have been compressed for mobile. The interface is a simple scrolling menu and the extreme consumption of device.present is the same whether we move on it or not. We don't use any materials neither anti-alliasing.

    Would any of you have any clue about what is happening here ?

    Thanks a lot,

    Thibaut
     
    MaestroMMT likes this.
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    What Unity version are you using ?
     
  3. thibautvdumont

    thibautvdumont

    Joined:
    Oct 6, 2015
    Posts:
    25
    Sorry, I forgot to precise it . We are using Unity pro 5.2.1f1
     
  4. MaestroMMT

    MaestroMMT

    Joined:
    May 31, 2015
    Posts:
    26
    Hello,

    Finally, we found the issue. We had to change all gameobject children of the shader with an empty material wtih a material with a custom shader.

    Bisous
     
  5. Haelle

    Haelle

    Joined:
    Feb 18, 2015
    Posts:
    3
    Hello,
    I'm interested in more details on how you fixed it !
     
  6. thibautvdumont

    thibautvdumont

    Joined:
    Oct 6, 2015
    Posts:
    25
    Haelle, actually the problem is only partially solved.

    So basically, we took all the image game objects contained as children in our Canvas and applied a dummy material with a custom shader instead of letting the field on none. The custom shader is a basic unlit shader with alpha channel, though we got some results with the default UI shaders too. We got some performance improvements with this (it's a nonsense of though), but we can't get a really smooth menu no matter what we change. You can relate to this post : http://forum.unity3d.com/threads/heavy-load-for-device-present-in-a-gui.360186/ for the custom shader.

    We couldn't get any other improvements as it definitely seems that Unity 5 has very poor performances for android and is, like really, buggy with images. Have a look there : http://forum.unity3d.com/threads/la...ndroid-tablet-galaxy-tab.358533/#post-2340564
    Deleting a single image saved us 10ms...
    So we are waiting for the Unity team to release a fix.
     
  7. Kumo-Kairo

    Kumo-Kairo

    Joined:
    Sep 2, 2013
    Posts:
    343
    Hi!

    Can you share your custom dummy shader? We have a similar problem and are trying to solve it. I've already tried a few default shaders, including non-transparent ones, with little luck.

    Thanks in advance.