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. Dismiss Notice

Unity Profiler: Device.Present and FPS Drop Problems

Discussion in 'iOS and tvOS' started by MoribitoMT, Oct 21, 2017.

  1. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    I made days of research about this Device.Present problem. This is a weird one really, it is around for 10 years, I found post from 2010 and 2017 people still having same problem, and this need to be solved.

    TEST ENVIRONMENT:
    Unity: 5.6.3p3 build
    Devices: iPhone 5, iPhone 6s, iPad 2017 (9 inch) ,Samsung Tab S2 ( SM-T713 ), Samsung Galaxy S2, Samsung Galaxy S4 Mini
    Game: A Racing game
    Quality settings: Minimized, Vsync of, targetframe = 60

    PROBLEM:
    All devices shows same problem, however I will take iPhone 6s as explanation
    Game starts as solid 60 fps, after 2-3 minutes later drops to 30-35 fps, sometimes goes back to 60 fps
    Profiler shows huge spikes of "Device.Present", it is like 1 second 0.01 ms and 3 seoncds later 10-11 ms

    ANALYSIS:
    My scene and scripts greatly optimised
    Combined meshes, almost all atlas based textures, very few materials, mostly mobile shaders, carefully designed NGUI panels, my profiling stats are great, very high number of saved batches.

    TEST 01
    My only expensive shader is "Standard" shader on my player vehicle's body mesh. I even convert this to "Mobile Diffuse". My "Device.Present" spikes changed, they became less and milliseconds down from 10-11 to 6-7 ms. However still mostly 30-35 FPS running

    TEST 02
    I put SECTR occ culling scripts, image effects ( Beautify from asset store ), etc.. I give CPU much more job to handle, and this gave me solid 45-50 fps, spikes were so few and insignificant

    RESULT
    It seems that iPhone 6S CPU does everything very fast, and waits for GPU, and this cause "Device.Present" spikes

    ANY IDEAS ?
    I am out of ideas on this issue, any one else have this problem and find solution ?

    Regards to ALL.
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    816
    Does it also happen with the android devices listed?
    Vsync is forced on for iOS, you can't disable it.
    Just to be sure, are you profiling in the editor or on the device itself? Can you take a screenshot when you see a spike?
    Are you using any image effects or multiple cameras? What kind of UI are you using (Overlay or Camera)?
    Whats your drawcall count?
    Did you check if you produce any garbage?
     
  3. PuzzledBoy

    PuzzledBoy

    Joined:
    Sep 9, 2014
    Posts:
    23
    Hi,Do you check the Multithreaded Rendering on PlayerSettings?
    Note that Multithreaded Rendering only work on Metal graphics API,according to Unity docs https://docs.unity3d.com/Manual/class-PlayerSettingsiOS.html

    May be your multithreaded feature was disable because you use OpenGLES2 not Metal.
    I check the Auto Graphics API to use Metal, and GLES2 as a fallback.

    upload_2018-5-31_15-5-28.png


    Android has Multithreaded Rendering as well ,you should take a look if you don't check it.
     
  4. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    I have a similar question to answer, but it is on the Switch platform, thank you.
    https://forum.unity.com/threads/why...lly-static-but-the-freeze-is-serious.1145033/