- Home /
What can you change for a statically batched mesh?
This seems like something that ought to be documented, and that should have been asked before, but I'm not finding the answers. Here are the things that interest me most, but I don't have a problem with a bigger list. ;-)
Material? If not material, how about just the shader used on the material?
Vert colors?
I don't have pro, so I cannot say for sure (hence its a comment), but if it is anything like dynamic batching then changing any properties in the material will create a new instance of that material, and then it can't be batched anymore.
That only happens if you work with materials ins$$anonymous$$d of shared$$anonymous$$aterials. I know how to deal with that, when it comes to dynamic batching, but static batching remains a mystery hence the question! :-)
Jessy, I'm surprised you have questions at all. I was under the impression you had Unity WELL figured out. I'll be following this... and even going to try learn what a Statically Batched $$anonymous$$esh is...
bump, good question. Being able to change vert color or hue of overall diffuse texture of a batched prefab would give a beneficial variety to reused meshes.
Answer by loopyllama · Mar 08, 2011 at 08:40 AM
Hi Jessy,
This is "my answer" which is really "my guess" but it is a guess based on a similar feature I worked with at a studio. If it is indeed the same feature, then all batching is doing is making many objects into 1 object with 1 material at runtime. It combines all the geometry together into 1 big object. An object can only have 1 material so before the runtime batching happens, all of the materials have to be the same material because that one super combined object only has 1 material. So why wouldn't you just combine objects A, B, and C in your 3d software? You are giving the engine a chance to cull out, for instance, A and B but draw C one frame, then draw A, B, and C the next frame, then draw A, B and cull C the third frame with Frustum Culling and/or Occlusion Culling, but use only 1 draw call each frame. If you had combined them in your 3d software it would still be 1 draw call but it would not be able to cull out A, B, or C since it started as one big object. You are missing out on that potential performance by combining meshes in your 3d software.
That is a long way of saying you would have to treat all the materials of your batch candidates like it was 1 material if you would like them to batch.
I also believe that static batching is the same as dynamic batching with the animation code cut out for faster performance.
I think this is right but take it with a grain of salt :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613111801im_/https://answers.unity.com/themes/thub/images/avi.jpg)