I have this issue I can’t overcome. Looked in the forums, Answers, Google… hell, even asked on the IRC channel. No solution. Skim to interesting for the interesting part.
When I run my game in the editor, it runs smoothly. When building and running the build, it runs real slow (low FPS). This now happens on my MacBook Pro. It also happened on a PC laptop I tried. Fine in editor, bad in build.
The PC seemed to be problematic however (Windows 10, NVIDIA-something-decent). I tried running a benchmark-test-application to see if it’s only my game or an OS thing but that app ran also like a sick grandma. I figured the OS is pigeon-poop because I played around with it too much and went on. The MacBook Pro is what I want to fix right now.
On my main machine, PC with Windows 10 and an NVIDIA GTX 1070, the game runs smoothly both on editor and build.
interesting: Running the profiler I get that the function gfx.WaitForPresent is taking most of the frame time. That means v-sync stuff as I read in some dark places on the web. I tried disabling v-sync in the Quality settings of my project and build again (on the MacBook) but it still ran like a sick grandma.
So there, I’m a bit lost. I’m not sure if it’s a Quality setting or the OS deciding not to run with hardware acceleration or whatnot… Please provide your input.
Divide and conquer! create a backup, and then try deleting elements in your scene until you (hopefully) delete the object(s) causing problems. If you find that after deleting all scene objects and the problem still exists, you could try creating an entirely new project and just building the blank scene. Depending if a blank project does the same thing might help you (and others) to narrow down the list of suspected culprits.
Hi, I finally got up some alone-minutes with the Mac. I disabled all objects in my scene but the player controller (based on Unity’s standard assets + some mock gun), I disabled all post processing effects I have on the camera, and I made a plane and four cylinders so I can stand upon and see if the movement is jerky.
It is.
It was mentioned above I “make sure the same graphics API is used between editor and build” - I’m not sure what to do with this advice, to be honest… an explanation maybe?
Here’s a screenshot of the profiler on the Mac build running jerky-ly with the first person controller running around aimlessly on the plane with the four cyilndars of doom.
Hello, still no luck.
I went to the player settings and ticked off the Auto Mac Graphics API. I tried both available settings I had (screenshot) and both had bad performances on the full scene. With the scene simplified, the perfromance was better with the OpenGL chosen. I still saw gfx.WaitForPresent spikes in the profiler, but they were “only” 18ms so the game seemed smoother (remining it is the player, plane, and 4 cylinders).
I will try a scene from scratch, or a game from scratch, etc. For now, please give me more ideas on what to check if something pops to mind. Thanks.
gfx.WaitForPresent is when the CPU has finished its job and is waiting for the GPU to catch up. Macbooks are not known for having great graphics, and Nvidia-something-decent doesn’t help me understand what you’re working with
For me, that was actually the most interesting part. If the benchmark test ran badly, why do you expect your game to run well? Did you run the benchmark on the MacBook or Windows? It would be nice to know what hardware you have (on Windows, open the Search and type “dxdiag”). CPU and RAM (on main page) and GPU(In the Display tab) is what I’m interested in. Also, on the latest update of Windows, in the Task Manager you can see how much GPU power is being used. If during the game it shows 99% GPU usage, that’s a problem.
The last thing I can think of is to try to make another empty scene IN THAT PROJECT, drop in only your character and a few primitive objects and see how the performance is. If it’s bad, try a new project with the same basic scene type and see what the performance is like.
Hey @DroidifyDevs
While I can’t answer some of your questions regarding the hardware used (at the moment. Computers not available.), I did make the empty scene tests. Stuff is interesting:
(MacBook->) An empty scene on the project with some game objects yields a slowness with WaitForPresent. So as suggested I tried a new project from scratch, imported some silly model from the asset store and duplicated it to make my MacBook sweat. Same result! Slowness also appeared here. Reminding that this is build only. In editor I get good results and the profiler doesn’t show WaitForPresent as a blocker, only seemingly regular methods at work.
Another interesting thing I noticed which might help debug this, is that WaitForPresent occurs in spikes. Most often, they happen every ~3 frames. Then after some time it happens continuously for a few frames, then back to 3-4 frames. Is this a clue to anything?
Again sorry for late responses. I’m not on this 100% fulltime. I only have a few hours here and there to play around with this.
Hi, I am facing the same issue on a MacBook Pro 2018… It should run fine, since it should not be too hard for the Mac to render my scenes.
Have you tested around with Post Processing and / or the HDRP? I did and thought possibly it could be caused by them (although I completely removed them from the project)…
Hey @jo_achim747
Sorry but I don’t have that Mac anymore and never resolved it on it. If you’re interested I think I can initiate a Mac cloud build for that project so can try running it if that might help in any way . I think I have that project lying around here somewhere…
Just in case anyone comes across this thread in future, I ran into two issues/fixes of a similar nature (slow FPS on mac build vs. Unity editor) that are something good to look at at least to start with, if you’ve optimized your scene well:
I was running my game mode in the editor at the correct resolution for my mac (2560 x 1600), but NOT set to maximize on play, so the frame buffer in the editor was lower than in the build. My solution was to force the build to run at a lower res (1920 x 1200) instead of native res (2560 x 1600) on 13" macbook pro with retina display.
Will always test performance in editor using maximize (or setting the window manually) from now on.
I had Mac Retina support toggled on in the Player Settings. Turning this off increased my frame rate by 10-15 fps in my build (albeit at the slight expense of image crispness).
Issues like these are most often caused by weak GPU coupled with running game view in Unity at low resolution and running the game in fullscreen at native/high resolution.
I havw this issue and I can not solve it.
CPU : Intel Core I7 10510u
GPU : Nvidia GeForce GTX 1650
RAM : 16 GB
Resolution : 1920 x1080 @ 60 Hz
OS : Windows 11 64 bit
Integrated GPU disabled to increase RAM accessibility for the CPU.
CPU usage : 26 percent
GPU usage : 11 percent
RAM usage : 9 GB out of 16 GB
GPU VRAM usage : 1.9 GB out of 4 GB
Build FPS : 3 to 7 FPS
Editor FPS : 50 to 130 FPS
please help. thank you very much.