Optimizing for integrated graphics cards
Polygon count matters
On most graphics cards today, polygon count does not really matter. The common knowledge is that object count and fillrate is much more important. Unfortunately, not so on the majority of integrated chips (most of them being Intel cards). Every polygon matters. How much it matters depends on the complexity of the vertex shaders or lighting and the speed of the CPU (thats right, most integrated cards transform & light vertices on the CPU).
Big Bang Brain Games never went above 25,000 triangles in a scene using 1-2 vertex lights and no pixel lights. Quality Settings were used to speed up performance automatically when frame rate drops. So on higher end machines a higher quality setting was used which had pixel lights enabled.
What slows things down is drawing objects multiple times, using complex vertex shaders and lots of polygons. This means:
- Do not use pixel lights. Pixel lights make the object be drawn multiple times; once for ambient pass and once for each pixel light.
- Try not to use lights at all, even vertex lights. Lights make sense if your geometry moves, or if your lights move. Otherwise bake the illumination, it will run faster and look better.
- Optimize your geometry (see section below).
- Use Rendering Statistics window and Profiler!
Optimize model geometry
When optimizing the geometry of a model, there are two basic rules:
- Don't use excessive amount of faces if you don't have to.
- Keep the number of UV mapping seams and hard edges as low as possible.
Note that the actual number of vertices that graphics hardware has to process is usually not the same as displayed in a 3D application. Modeling applications usually display the geometric vertex count, i.e. number of points that make up a model.
For a graphics card however, some vertices have to be split into separate ones. If a vertex has multiple normals (it's on a "hard edge"), or has multiple UV coordinates, or multiple vertex colors, it has to be split. So the vertex count you see in Unity is almost always different from the one displayed in 3D application.
Bake lighting.
Bake ligthing either into lightmaps or vertex colors.
Maya has good builtin lightmapping tools. Unity can import secondary UV maps or vertex colors from Maya.
The process of generating a lightmapped environment takes a little longer than just placing a light in the scene in Unity, but:
- it's going to run a lot faster (2-3 times for eg. 2 lights).
- and look a lot better since you can bake global illumination and the ligthmapper can smooth the results.
Even next-gen games like Gears of War still rely on lightmapping a lot. Usually they use lightmapped environments and place dynamic lights on top. The builtin Lightmapped shaders can do exactly that in Unity!
