So yeah,
im getting really “low” fps for the scene im having, ~ 93 models, low quality mesh, nothing special, but each one has like 1-2 materials for it.
I dont know how to do it better, but that seems the issue? Can unity not handle “large” amounts of objects? I mean like, 93 models, its nothing. not even a small city.
Any tips to improve that?
In the most simple terms you need to keep you communication between the GPU and CPU less frequent, because it’s slow as compared to intra communication in the CPU itself. There are two main factors that cause frequent communication between the GPU and the CPU.
-
Draw Calls: To keep it short, a lot of meshes that use different materials, all cannot be sent to the GPU in a single call to be rendered. Thus they cause a lot of draw calls. To keep this number low you can combine meshes into one and make sure that a single material can be shared amongst many different meshes/renderers. Sub meshes also can break DrawCalls so they also need to be merged.
-
SetPass Calls: Draw call sets up a mesh and submits it for rendering, whereas a SetPass call is when all the data from a material for rendering a mesh is setup. When a material is not changing it is often possible to skip SetPass calls. Each time a material is changed, it results in a new SetPass call. So to lower this number you need to somehow combine materials as much as possible
Thus, If you have a complex scene containing high polygon 3d models with a lot meshes that use a lot of different materials, the overall performance of your game will suffer. You can check out my tool on the unity asset store “Poly Few” that aims to solve this problem by allowing you to optimize high quality complex 3d scenes. With integrated features like mesh simplification, automatic LOD generation, mesh merging and material combining, you can greatly improve the performance of your game by lowering the Polygon Count, DrawCalls and SetPass calls with a few clicks and, without the need of writing even a single line of code.