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

MacOs Build - Fullscreen extremely low FPS

Discussion in 'macOS' started by sincerelysleepy, Feb 17, 2021.

  1. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Hello there. I'm creating a 2d game on my windows machine using Unity 2019.4.17.f1. When I create a build for Windows, it runs smooth on pretty much any windows machine that's not a cardboard box. When I create a build for Mac, it seems to run fine on some 2015 Macs (i7, 16GB ram, Intel Iris Pro 1536 MB GPU) if the game is not in fullscreen mode. The moment I put it into fullscreen, the fps drops to about 2-5fps. Here's what I've tried:

    • Turning v-sync on and off
    • Turning general graphics down
    • Turned off Mac Retina Support in player settings
    • Setting Mac graphics API to Metal

    I've done a bit of digging and seem to be at a loss. I found this article that talks about a workaround in a way, however, that's not ideal. Please assist! Thank you
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    What resolution are you rendering at? Did you try reducing it?
     
  3. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    It's set to Default Native Resolution.
     
  4. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    I've changed it to be 1920 x 1080 and it seems to have helped quite a bit but it's still laggy.

    Here are my settings:

    Resoultuion
    Fullscreen Mode: Fullscreen Window
    Default is native resolution: false
    Resolution: 1920x1080
    MacRetina Support: false
    Run in Background: true

    Standalone
    Capture single screen false
    Use Player Log: true
    Resizable window: false
    Visible in background: false
    Allow fullscreen switch: true
    Supported aspect ratios: All checked
     
    Last edited: Feb 17, 2021
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    Did you try using the profiler? I wonder if your game needs more GPU power than is available on that Mac.
     
  6. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Okay, so I wasn't actually aware that the Player settings get saved in a .plif file. I was exporting new builds with different settings and not actually seeing any change. After deleting the file and creating another build with 1920 x 1080, it completely fixed the issue. Makes me believe I was beating my head into a brick wall that wasn't changing. I believe this is resolved. Thanks for your help!
     
  7. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Some additional notes. Changing these default settings to this seems to work:
    • Retina Support: off
    • Res: 1920 x 1080
    • Fullscreen Mode: Fullscreen Window
    I can't image the game needs more GPU power. We're not doing too much, it's a pretty simple 2D game with HD art. On average, the game sits at about 46 batch calls.
     
  8. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    I'm actually going to open this back up. It seems as if the issue is very intermittent. I had a single build work on 1 macbook pro one day and then not the next. It almost feels as if the game is trying to force a different resolution even though I'm specifying 1920x1080. Being that our game is 2d, we really want to set that a hard limit as the "max" size. If I play the game in windowed mode at 1920 x 1080, it seems to work fine.

    I've actually pulled my code down in the editor as well and noticed the same issue if the resolution is anything above 1920x1080. FPS runs at about 160 but dips down to about 15 if it goes above. Is it possible to get the game to be "full screen" at 1920x1080 even if there are letterboxes happening? Is it common to downscale the user's resolution while their game is running?
     
    Last edited: Mar 1, 2021
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    You can control the resolution with "Screen.SetResolution" call. Generally, PC games expose resolution selection in game settings so that players with lower end hardware could reduce it and players with high end hardware could crank it up.
     
    sincerelysleepy likes this.
  10. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    What will the result of that be? Say if the Mac has a 2880 x 1800 resolution and then we force a resolution to 1920 x 1080 with full screen, won't that just make the screen smaller, or would that still result in a "full screen" game that just is letter boxed if the aspect ratio isn't matched?
     
  11. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    I found this article and it actually explains everything extremely well and answers my question above. I'm going to try this solution and see how it works.
     
  12. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Okay, it appears the issue was due to MSAA being enabled at x4. It was just killing performance. All works well at 1920x1080 without MSAA enabled. Poor Mac GPU. Thank you!
     
  13. alejandrorak2

    alejandrorak2

    Joined:
    Jun 29, 2019
    Posts:
    4
    ily, turning of msaa helped everything
     
  14. ersinceylan

    ersinceylan

    Joined:
    Jan 13, 2022
    Posts:
    4
    Whatever i do, my mac also cant run my project above 30fps. Event empty scene, URP/Builtin max i can get 100-150fps. If i start to place a few low poly models, fps drops. Max i can get lik 50FPS. It is alll because of resoution. I am running game at 2880x1346 (free apect) full resolution. MSAA etc nothing helps. For example i am running a project now with many game objects on scene about 800K Verts. Minimized game view 20ms CPU time and, 53FPS. If i maximize screen i get 50ms CPU time with 20FPS. Even after build and run , i will get similar reults. I have seen some posts some people saying they can solve this problem by switching to OpenGL but it comes with some visual problems sometimes.
    Also my friend getting similar results in mac. I believe results in Windows will be much better.
    Also, in profiler, EditorLoop and PlayerLoop(GFX.WaitForPresentOnGfxThread etc , not my code) both using extremely high resources. Sometimes EditorLoop, sometimes PlayerLoop.