Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

GFX.WaitForPresent slowing down Android game!

Discussion in 'Editor & General Support' started by jamius19, Dec 29, 2015.

  1. jamius19

    jamius19

    Joined:
    Mar 30, 2015
    Posts:
    96
    I've a game in Unity!
    First of all, I'm not a noob :D

    I always follow the performance guideline..

    But this GFX.WaitForPresent is destryoing it!

    Attached the screenshot of profiler below!
    As I said, tried everything I can find...
    VSync isn't of any help!

    Any suggestion or help would be much appreciated! :D
     

    Attached Files:

    • asas.png
      asas.png
      File size:
      251.3 KB
      Views:
      2,407
  2. ObliviousHarmony

    ObliviousHarmony

    Joined:
    Jul 3, 2014
    Posts:
    79
    Hello,

    As far as I've always understood it, Gfx.WaitForPresent is simply that the CPU is waiting on the GPU. This could be because of VSync (which you have off), or it could be the frame taking too long to render or be displayed. You can see what the GPU is doing by pressing "Add Profiler" in the top-left and selecting "GPU."
     
    jamius19 and Dantus like this.
  3. jamius19

    jamius19

    Joined:
    Mar 30, 2015
    Posts:
    96
    Did that already...
    nothing out of ordinary there....

    I guess I'll have to live with that!
     
  4. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    628
    Are you using Blob Shadow Projectors by any chance?
     
  5. zerotech15

    zerotech15

    Joined:
    Jan 28, 2016
    Posts:
    94
    Unity 5.3.5f1 Personal. V-Sync is off

    I'm having the same issue on Samsung S6 edge, GPU profiler shows huge FPS. There are only 25 draw calls per frame, 80 triangles and the most expensive shader on screen is Sprite shader. My VR game for Cardboard is very sensitive to such slowdowns and it causes nausea. Rendering graph is 70% GFX.WaitForPresent so the real framerate should be far greater than 60. Do you have any idea what could be wrong with it?

     
    Last edited: Jun 24, 2016
    Etorrus likes this.
  6. tiagoorlando

    tiagoorlando

    Joined:
    Feb 26, 2018
    Posts:
    3
    Having the same damn issue for months with the latest 2018, with and without Vsync.... Don't even know what to do anymore...
     
  7. Bman262

    Bman262

    Joined:
    Mar 20, 2016
    Posts:
    2
    Anyone find a solution to this ?
     
  8. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    You need to profile your game to see where the problem is. WaitForPresent isn't a problem in and of itself. It indicates that the CPU is waiting for the GPU to finish doing some work. This could mean that the CPU isn't doing much and your shaders are too complex, or it could mean you're doing too much on the CPU (more than 16ms worth of work) and missed the current vsync so you have to wait for the next vsync. It could also show up even if everything is working fine and you're running at 60 fps.

    There's a good explanation of WaitForPresent on the Oculus forums here.

    Sam
     
    alemnunez and Fibonaccov like this.
  9. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    280
    same issue, any help?
     
    bekiryanik likes this.
  10. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    I have opened a new thread about it. I am using the latest version of Unity. The problem occurs even in the 2D empty project too. I think there is something wrong with the Unity program.
     
  11. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    612
    unity android default frame rate is 30...add the editor over head, any lights..20 fps, add the unity remote synch...10...

    Find a script used in every scene, at the top , add this...see what happens.

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         // Make the game run as fast as possible
    4.         Application.targetFrameRate = 300;
    5.     }
     
    Last edited: Jan 7, 2019
  12. Nullic

    Nullic

    Joined:
    Nov 16, 2016
    Posts:
    3
    In my case it happend because I have enabled shadows. Try to disable them.
     
  13. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    96
    I have same issue, after upgraded to Unity 2018.3+, it get my game fps from 60 to about 35. Everything is same just Unity upgraded from 2018.2.13f1 to 2018.3.x or 2018.4.x. Any tips?
     
  14. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    96
    I found the solution:
    Disable multithread reander, you can see details profile infomations about render, and i found that:
    GPU Skinning on my android mobile is very slow, cost about 10ms every frame, even just one simple skinned mesh. So i turn off GPU Skinning, then the fps boost.
    Unity 2018.2.13f1 has no such issue, 2018.3 ~ 2018.4 do have.