- Home /
Should I build my level with few meshes or many meshes on the iPhone?
I'm creating a game for the iPhone where the level is a maze laid out in a grid (think pac man). You'll be in the maze, first person perspective. Given the occlusion culling and static batching on the iPhone, should I make each block in the grid a separate mesh? As I understand it, the batching will make it so the whole level only takes up one draw call (as long as I make a texture atlas) but those blocks outside view will not be rendered, so reducing the triangle count. Am I correct in this? Or should I make the whole level into one mesh? (As I understand it, I should probably do that for a Mac/PC build to reduce draw calls as there is no batching currently in those builds.)
Back to the iPhone - if I keep them separate and create a texture atlas, does it limit my lightmapping options?
Answer by Eric5h5 · Sep 28, 2010 at 09:25 AM
Unity 3 does have batching for Mac/PC. Ideally you should use objects that are separate enough for occlusion culling to work well, and use static batching. Both of those require Unity Pro. Dynamic batching has more overhead and is limited compared to static batching.
Great! Thanks. That'll really help if I come to port it to other platforms. Is one object per grid cube separate enough/too separate? And do I need to do anything special to enable static batching, or is it automatic if meshes use the same materials?
@Robin $$anonymous$$ing: One object per grid cube seems O$$anonymous$$, though I'm not sure. You need to mark static objects as static, and enable static batching in the player settings.
Right... I've not come across marking objects as static yet. Is that in Unity iPhone? I'm coding so far in Unity Indie 2.6.1... And is it possible to create static objects at runtime, either from prefabs or otherwise?
@Robin $$anonymous$$ing: Actually I was talking about Unity 3. As I mentioned, static batching requires Pro. Dynamic batching (works in Pro and Basic) is in Unity iPhone 1.7, but not Unity 2.6.
Your answer
Follow this Question
Related Questions
Dynamic batching 6 Answers
Optimizing large numbers of trail renderers 0 Answers
Batching on moving objects[Solved] 1 Answer
How to make common material for CPU optimization? 1 Answer
Why is my game doing 175 SetPass calls and 2319 batches? 2 Answers