Is it possible to change the colour of game objects without increasing the number of draw calls?

As an experiment, I have a simple game object instantiated a few hundred times, and I’m trying to set the colour of each instance separately in code.

I understand that when I modify the material on an instance (i.e. renderer.material.color), the number of draw calls increases, since it effectively becomes a new material (is that right?). Interestingly this happens even when renderer.material is accessed, not modified.

Out of curiosity, is there a way to set the colour of an object without increasing the number of draw calls? Only thing I can think of is using particles instead of individual game objects, but I’m wondering if it’s the only option. The plan is to animate them so I can’t use the CombineChildren script…

Yes. There is a way. You can set the vertex colors. Your texture should be a white texture and the shader used for your material should read/use the vertex colors (most particle shaders do).

This way you can choose a different color for each object while keeping the same material, thus preventing additional draw calls.