- Home /
Why is my framarate so bad?
I've been typing a bunch of code for a game I'm creating. However, when testing some simple AI code I found my frame rate was already going down to 30-40.
So I went and traveled the internet for some hours and did the following:
Used the profiler to find what was giving problems; rendering being the only one that stuck out, together with vSync.
Used to frame debugger to find out what was going on. Here found that over half my draw calls where actually from the main canvas (which is quite large but nothing extreme, maybe 100 children in total)
I removed things from the scene as much as possible, only leaving the player on a tiny platform.
Building and running the game as Windows stand alone.
Using a batching script (even though there is nothing to batch really)
Each of these resulted in pretty much exactly the same frame rate of 30-40 frames. Only making the screen smaller helps but at this point you can hardly see anything and the frame rate is barely 60.
I haven't done anything with the lights yet. All that is in my scene is the player, a plane to stand on, 2 NPCs, a directional light, an empty GameObject with some controller scripts and the Canvas. Nothing else, so now what can I miss here that is giving such bad frame rates?
I saw people asking for people's specs in other posts: I'm on a laptop, I7-4700MQ 2.4ghz with GeForce GTX 765M and 16GB RAM. Unity 5
can you show me your inspector and also are you using legacy GUI ? also any debug usage or print ( debug.log or print() )
also are you sure your laptop isnt running on some sort of saving power setting, and also is unity using the GTX gpu or intel for rendering ?
@AngryBurritoCoder There are some more children in the Canvas which are hidden now but like I said about 100 total. No Debug statements, no Print statements, I only use one line of legacy UI to show which target the player has selected (for testing only)
$$anonymous$$y laptop is always in High performance mode (I checked to make sure). Isn't Unity using my GPU by default? I wasn't able to find any settings about that.
that's why I'm sticking to 4.6...framerate is bad for anything I do in 5.xx
@AngryBurritoCoder What do you want to see in the inspector by the way?
Answer by Bunny83 · Sep 01, 2015 at 04:59 PM
Well, if the framerates drops when you enlarge your screen, that simply means that your GPU is simply not strong enough to provide the required fillrate.
If you don't have a high-end GPU you might want to exchange the new Standard shader with the old legacy ones. The Standard shader can be quite demanding, even on high end hardware. It also increases the build size significantly (especially on Android).
edit
Just read what GPU you have in your laptop. Well, according to wikipedia the fillrate shouldn't be a problem even with full HD resolution. 12 GP / s should be more than enough ^^.
Like others have already mentioned, are you sure that your laptop is actually using your dedicated GPU and not the internal one? It usually helps when you simply disable the internal one in the device manager completely.
Thanks for the answer. I redid everything I did before and it seems like you were right about the video card. I ran it again and there it went:
Its not as high as I think it should be, but of course I would expect less out of a laptop running it in the editor than a PC on stand alone.
Answer by getyour411 · Aug 31, 2015 at 11:46 PM
Your screenshot shows 428.8 fps
Not sure how that happened but when I run the game on a maximized screen it is always 30-40. When I run on a small screen like in this second screenshot its around 60 which is still pretty bad.
If you ave Vsync on the game will run around the 60fps mark. Discrete cards like A$$anonymous$$D and GTX will have an app, probably hidden in your status area where you tell the system what applications you want to use the GPU ins$$anonymous$$d of the integrated card - do check that.
Your answer
Follow this Question
Related Questions
FPS in single digits... on ATI Radeon 3000 1 Answer
low FPS when battery is low ( unity android ) 0 Answers
How to calculate an accurate frame duration? 0 Answers
in-game grid made of GameObjects 1 Answer