- Home /
Optimisation for a noob (who has tried)
Hi Community!
I have been working on a game, as a hobby, and I have run into a block which I cannot overcome. The problem to put it simply is that I am getting a terrible FPS. That is rather vague Im sure but it is, in essence, the problem.
I am going to ask a number of questions and also layout what I have tried.
I use Unity Free Version. My game is a dynamic environment which has thousands of grass, plants, trees etc. I dont use the terrain editor to place the vegetation, I instantiate them as prefabs. They come from the Asset Store: https://www.assetstore.unity3d.com/#/content/3277.
I get the following stats during runtime:

What stands out for me are Verts and Tris. Perhaps you could point out further issues.
I tried using instant OC for occlusion culling to try improve the performance. Unfortunately, after playing around with the settings a bit, it turned out that it is just not suitable to my game. Objects flickered a bit and some weren't rendered at all.
I looked into CombineMeshes, and also got hold of the following script: http://wiki.unity3d.com/index.php?title=MeshMerger. Unfortunately I didnt notice any improvement in the performance. The other problem was that the trees in the above mentioned package have 2 materials and thus the script doesnt work for them. I do feel like I could explore mesh merging further. So a question would be, should I pursue this?
Another idea I had was to target a certain FPS (eg 80fps). Then only render objects only 50% of the time by doing gameObject.renderer.enabled=true/false. This would in theory mean that objects would have an effective fps of 40, which would be ok. Im not sure whether this is a decent idea even, but it didnt work as the object just flickers.
My last point is a question about Unitys terrain editor. Why can I place many objects using the terrains: "Place Trees" or "Place Grass" and still achieve a decent fps? Do I have access to trees etc at runtime, like removing or adding objects to the terrain dynamically via script?
Thank you in advanced for anyone who reads through this and can help me; even just a little bit. I know its a lot!
The Profiler is a great tool. Do you think you could post a pic of what's happening there? It's Window->Profiler (make sure your game is running)
Hi drod7425, thanks for the response. I Profiler is greyed out. I assume it is a Pro feature?
Verts and tris are at tolerable levels. The issue here is the massive amount of draw calls. You may want to use a smaller far clip plane and/or utilize the Camera.layerCullDistances.
Answer by Dave-Carlile · Nov 06, 2013 at 08:33 PM
That is a very large number of draw calls. Reducing those is going likely be your best optimization approach:
http://forum.unity3d.com/threads/126332-Draw-Calls-Max-(ideally)
http://answers.unity3d.com/questions/14578/whats-the-best-way-to-reduce-draw-calls.html
Your answer