In my game I am having an issue with my performance. But let me back up a little and explain where my issue comes from.
It’s like this: My game has 10 scenes (for now, its a long demo!); Each scene is laid out like this:
Scene
3d room
Up to three cameras and each with their own SSAO and Bloom components
Room Lighting
3d Object that moves (using iTween)
I also have an FPS counter to better illustrate performance. But the thing is that, according to my FPS counter, it shows that my scene runs at 15 (at maximum) FPS and each of my scenes are very simplistic and should at least run at 60+ FPS (at minimum). I went online to research what might the issues be and I found very useful tips like:
making each of my scene’s room be static,
using light-mapping
writing up a script that enables the Bloom and SSAO effect for the active camera and disabling the unused cameras.
But this only caused my FPS to go up by only 2 or 3. And I also clicked on statistic in the Game window and the odd thing is that Unity’s FPS show that my game is running at 60, 70 and even 89 FPS but my in-game FPS says that my game is running at 15, 17 OR 19 FPS.
Of course, I have done this testing in my executable and it is still runs at 15 FPS so I do not know why it is still doing this.
What I want to know is,could it be because of my many scenes scenes? While running one scene, could Unity be rendering all of my scenes in the background at the same time? Or an even broader question: what other improvements have I missed that will help improve my FPS?
Thank you for your time and many more thanks in advance!
I have a question, is there a way to access the player settings programatically? Mainly, I want to set a boolean value for the Static Batching and Dynamic Batching.
Like KelsoMRK suggests, figure out what’s causing the performance issue first. Don’t worry about static batching, post-processing effects, or anything like that yet. You can’t productively optimize until you know what you need to optimize.
Also a good tip which I’ve learned the hard way a few days ago : Get rid of all Debug.Log calls. I’ve spent about an hour staring at the code and wondering why my single scene with 20 sprites was running on 17 fps. Turns out I’ve left 4 Debug.Log calls in the OnGUI code I was working on before.
Thats really weird because debug.log calls take up basically no processing power… if they are demining the performance of the game that much, there is a problem with your code somewhere… And it needs to be optimised. Try optimising all the code you can throughout your whole project, this can greatly improve performace in some cases
Debug log will happily ruin any computer. They take up a lot of time, due to the unity editor overhead. Especially if you’re flooding the editor with several per frame.
Wow I have never had this problem, I usually run several debug.log calls simultaneously in infinite loop functions and I have never had a performance issue with it
I guess it would vary greatly depending on the specs of the computer it is running on.
In my experienced, I always to check performance profiler (CPU usage, GPU usage, Memory usage) on unity3d first and then find function to top overheads.
I think you should to know on where comes from delay or which functions leads to delayed and why…
Srry my native is not english so not good but i wish this will be helpful to you.
– ref –
– ref –
→ Kinds of like this custom profiler always helpful on my projects performance optimizations.