- Home /
Why isn't my static batching working?
Hi,
My scene has many objects that don't do anything such as terrain, I have set these to static in an attempt to batch them up and send them as one draw call as the meshes are mostly identical, however when I trace my game I notice that this isn't happening at all.
I use around 50 of the same object, duplicated so they all use the same mesh but they are not all drawn together.
has anyone has this problem before and solved it or can provide any advice on how to check I'm setting this up correctly.
Thanks
@ Exalia: Found the solution yet? I have the same issue.
Hey, I'm not sure as this was a very long time ago and I wasn't very experienced but If I were to answer my own question now, I'd make sure all my meshes were using the same shader as this is the defining point when it comes to batching not the mesh.
Answer by GameVortex · Nov 20, 2013 at 01:11 PM
There is a couple of criteria for static batching to work;
1: Unity Pro - Static Batching is unfortunately only available on the pro version.
2: The renderers on the gameobjects that you want to batch need to share the same material.
3: Lastly, all the gameobjects need to be marked as static in the top right corner of the inspector.
Try double checking all of those first.
Here is also a little more information on Batching.
@meat5000 That would be for Dynamic Batching. Static Batching can batch for any size.
Yep, you are right. Been a while since I read that page :D
scared me for a second there meat :P
Check
Check
Check
I'll run a trace and see what happens :)
Also, I forgot: only $$anonymous$$eshRenderer and ParticleSystem can be static batched. You mentioned that you are trying to batch together Terrain, is that unity Terrain or an imported terrain model? Because Unity Terrain can not be batched.
Not sure how unity terrain works, I just know it's horrible on mobile platforms haha
No I'm not using unity terrain to answer your question. I'm not at work anymore so I can't run the trace but I will do tomorrow and get back to you on this :)
Your answer
Follow this Question
Related Questions
Static Batching with LOD Meshes/GameObjects & Other Questions 1 Answer
Only half my draw calls being static batched 0 Answers
Static batching modular city, good or bad? 0 Answers
Getting the triangles (not setting) of statically batched meshes? 0 Answers
custom staticBatchRoot for build time static meshes? 1 Answer