Search Unity

Question Wait for target FPS too long

Discussion in 'Editor & General Support' started by TheHaytam95, Apr 4, 2020.

  1. TheHaytam95

    TheHaytam95

    Joined:
    Aug 14, 2019
    Posts:
    17
    Last edited: Apr 4, 2020
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    It means you probably have VSync enabled, which prevents the GPU from refreshing the screen faster than the screen is capable of refreshing. Try turning it off to see if it helps.

    VSync can hurt performance. Let's say your monitor refreshes at 60 Hz. That means that it can only draw 60 pictures in a second. If the GPU is cranking out 200 FPS, about a third of those frames are wasted. So, enabling FPS can help the GPU reduce workload by not making it compute unnecessary frames.

    However, if you're not quite hitting 60 FPS with VSync turns off, then enabling VSync can reduce performance. It can often mean that every other frame takes twice as long to draw. That sort of seems like what I'm seeing in your graph.

    Anyway, try turning off VSync and see if it helps.
     
    TheHaytam95 likes this.
  3. TheHaytam95

    TheHaytam95

    Joined:
    Aug 14, 2019
    Posts:
    17
    Alright, now with Vsync off the framerate was improved a little (Almost 60 FPS).

    Now the profiler claims that it is "Waiting for Present on Gfx Thread"

    https://imgur.com/SfKdyeN

    Still GPU have 100 FPS with some spikes to 60.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    I think that means you're GPU-bound. Unity's ready to render the next frame, but the GPU's still busy. If you look at your GPU performance, is it maxed out at 100% now?

    Being GPU- or CPU-bound isn't a problem it itself. Typically, you'll be either one or the other. Either the game goes so fast the CPU can't keep up, or the GPU can't keep up. That's fine, as long as you get good enough framerate at the point this occurs.

    Diagnosing GPU performance issues tends to be much more difficult than CPU issues, since the profiler can't tell you specifically what's taking a long time. You can get clues, like if most of your time is spent drawing shadows, maybe you have too many lights. But at a certain point, I think you just need to start turning off objects, or even graphics features, to and trial and error compare the performance results.

    From your screenshots, it looks like you've got a fairly large open world. In those kinds of games, you'l almost certainly need to implement LOD to keep GPU performance up. Have you looked into that yet? Occlusion Culling is also pretty important in most cases, but it might be less useful in your game if you've got such a large open world where there isn't much to block line of sight,
     
    TheHaytam95 likes this.
  5. TheHaytam95

    TheHaytam95

    Joined:
    Aug 14, 2019
    Posts:
    17
    Yes it is, i think that is it's limit. Is maxed out at 100%

    Yes, i have some buildings using LOD system and also Mipmaps & texture streaming. Also Occlusion culling was implemented, with this settings

    upload_2020-4-4_17-54-46.png

    There is only one Direct Light that is mixed (Baked & Realtime) and some Area Lights baked and i'm using Unity Batch system to reduce Draw Calls.

    I'm planning to use Mesh Baker to unify buildings meshes and materials.


    I guess that's the graphics card limit (Can't say i'm agry, it look pretty well and have nice 60 FPS)

    Thanks dgoyette
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Sounds like you're doing the right things, then. Maybe 60 FPS is just good for that graphics card. Good luck.