Colour sprites from atlas without increasing draw calls

Hello there.

When we use texture atlases, it’s quite recommendable to use either the sprite system or a single shader/material (or few) in order to reduce the draw calls because this way the engine will batch all of the textured shapes using the same texture (atlas) in a single call.

I have some sprites and I would like to ‘colour’ them in different ways, of course it’s always possible to overlay a transparent coloured layer over them, but that’s not a good approach, however, anything else is pretty much guaranteed to be inefficient (won’t ‘batch’) and not straightforward.

So, is there a way to somehow colour a sprite while keeping most stuff in a draw call batch? (of course besides the already mentioned solution to overlay them with a transparent layer)

Any help is appreciated.

The correct term I think would be “tint” instead of colour, anyway…

Just change the color of the sprite: GetComponent(SpriteRenderer).color = someColor. Or do it in the inspector.

–Eric

Thank you. Will that save up draw calls?

Yes, it does. You can verify this by opening the “Stats” window while the application is running the Editor. It will show the current number of draw calls as well as the number saved by batching.