Monday, December 2, 2013

Mesh Batching in Unity

After a couple of very personal posts about non-technical stuff, I've decided to write about something strictly technical: Mesh Batching. So, first thing is defining what I mean by mesh batching. I've found a definition I like from some game development forums (link here):

"Batching is a way of grouping geometry together (they should be compatible, e.g. the same material, context states, etc.) to use as few draw calls as possible. In this way, you could fully exploit GPU throughput, so as to improve performance."

Unity offers dynamic and static batching and they work generally pretty well, but they are automatic systems that need to work in every case scenario, which means they need to cover many possibilities. Normally it's easier to implement better optimizations for a particular case than doing it for more generic case scenarios. That's why I'm gonna be explaining here a way of implementing custom mesh batching in Unity that can improve its default system.

Beautiful screenshot of our work in progress title: Super Toy Cars