All objects use the same material, but don't batch

Basically the question is above. I have all the objects in my scene on one material, but for some reason, they don’t all batch. I assume the problem has something to do with the shared materials being different, but when I try and change all the shared materials to the same material in the editor, nothing changes. What can I do? I would really like this to work.

Have you checked all the limitations have been met according to in the docs? single pass shader , poly count , scale , marked as static?

Okay, I’ve found a few reasons in my travels…

  1. Are the materials being marked with (Instance)? Sometimes when you modify materials in code, they instance the map and won’t batch.

  2. Are the objects scaled? Scaled objects (so anything that isn’t 1.0, 1.0, 1.0 in scale) often don’t batch

  3. Objects too far apart sometimes don’t batch either.

I’m sure there’s more, but this usually ticks most of the boxes.

They have to all be of the same scale? I didn’t know that was a limitation? Also, where would it say instance? In the editor, they all just say the name of the material and when clicked on point to the same material. What’s weird is that in a separate scene, I had the same problem and I solved it by going through each object one by one until I found an object that was producing 2 drawcalls instead of batching them. I had to duplicate an object that was being batched and then switch the mesh and the scale. If I played the scene again, it then worked fine. But I don’t really want to go through 1000+ objects in my current scene.

I’m a bit vague on the exact reasoning (anyone is free to chime in here), but I believe because scale is a lossy system, when an object is scaled it gets stored separately and for whatever reason, that breaks batching.

In case any one was wondering, the solution to this problem is actually to just re-lightmap the scene. Once I did this, the draw call number sunk to what I was expecting.