Static batching questions

Hi, I am confused about static batching. I read that it can boost performance but it can cost memory. Not sure if I should do static batching or not. I read the documents but it’s doesn’t give a lot of examples.

So…I should mark my non-moving objects with the same materials as Static? Or should I just mark all my non-moving objects as Static? What’s the correct/ right way??

Unless you are running out of memory when running your game , mark all non moving objects as batching static.
It will reduce draw-calls if it makes sense.

thanks for the answer.

I am curious on whether disabling ‘mesh renderer’ on a object reduce draw calls?

It does, but you’re also not rendering that object then. A “draw call” means, more or less, that there’s a visible object on the screen that needs to be rendered, which has some CPU costs.
Static batching (for non-moving objects), dynamic batching (also works for moving objects), instancing (for rendering many instances of the same object) or combining meshes that use the same material reduce the draw calls.
Static batching has some memory costs, dynamic batching has some CPU costs, combining meshes is not always very practical. Instancing is generally a good idea I think (might have some downside too in some specific situation).

1 Like

Thanks for the explanation… But now Unity do some weird stuffs without letting me know when I mark static on my objects.

It started baking some weird light transport thing and now my lighting is all screwed… How do I revert back???

Go to lighting, uncheck “auto” and the on the dropdown on the right you can remove any lightmapping that might have occurred.

I already tried that, turning off auto and under ‘Build’, I select ‘Clear baked data’ but nothing happen. There’s a indication of no lightmap and some objects are still black with darken lighting.

Just for clarification. Just Checkting static set “All” Static flags.
If you just need Batching , you just select the small drop down on the right of the static checkbox and select “Batching Static”.

Thanks, I guess i need to select the right one…

Managed to revert back by unticking all the options in Lighting>Scene and click build. The funniest thing is that Unity indicate that there’s no lightmap when my lighting is screwed up because of it.