Framerate Optimization Tips
warby's Tips for Drawcalls and Overdraw
Neither texture size nor polycount is usually the bottleneck but drawcalls and overdraw (fillrate-bound GPU)! Here are a couple of good rules of thumbs:
- Use as few materials as possible!
- Use atlas maps to get many small items together in one texture/material/shader.
- Batch a lot of small objects together on run time to reduce drawcall amount.
- 99% of your scene should use one and the same shader! Switching from one drawcall to the next has different amounts of overhead depending if its a different shader or not!
- So even if you cant batch stuff together it would still be good if it all had the same material/shader.
- Don't use alpha ! Seriously 99% of the stuff people use alpha for these days could be done with actual geometry and it would both look better and perform better!
- Use as little transparent stuff as possible... if transparency cant be avoided (fire for example) make sure it covers as little screen space real estate as possible and doesn't come in multiple layers. Special tip for FX artists: 1 sprite with an animated texture will usually look more awesome than 10 layered sprites with a static texture! And it will perform better too win/win scenario!
- I think this will become less and less relevant but try to have as few hard edges (smoothing groups) and UV-cuts as possible in your model the less split vertices the better transform time (but your game is probably not transform bound anyway).
- The thing above + clean poly flow will ensure better triangle strip generation! Which saves memory and transform time! Yes sometimes MORE geometry can result in less memory use and less performance loss if done right!
- Transform time for vertices on skinned meshes (characters) is more costly than that of static world geometry so don't apply your optimization knowledge on how many polys to spend from environments on characters!
I am framerate nazi ... there you have it!