Forcing a single instance of material on meshrenderer material array not reducing batches/drawcalls

I’ve imported a 3d model. The imported model has 8 materials.
In the inspector, I’ve overridden all materials to use the same material.

2924610--216100--ss1.jpg

Then I created a script to ensure during runtime, all slots are using the same instance of the material

2924610--216101--ss2.jpg

You can see that there is now only one instance of the material.
However, when analyzing the statistics windows, the batches and setpass calls have not been reduced at all. It is the same amount of batches and setpass calls occurring as if I I was using all different instances of a material. In fact, it almost seems like there are MORE batches and setpass calls.
Am I wrong in thinking that this is supposed to reduce batches and/or setpass calls?
Or do I need to do something else here?

Dynamic batching? Dynamic batching has a vertex data limit, ~900 vertex attributes depending on your mesh data, shader, stripping, some other rules, etc.

(I suspect you probably already know this sort of thing, but mentioning it just in case you didn’t or someone else hits the thread…)

1 Like

So I tested it again, and it appears to working now. Not sure why it seemed it wasn’t working before.
(I noticed sometimes the stats window can behave strangely when you starting activating and deactivating gameobjects items quickly. Unity 5.3)

It has now been reduced from 8 drawcalls, to a single drawcall.
The batches were halved.