- Home /
Optimising Sprites for 2D Unity games
I have a question about optimising sprites.
In another game development program I used to use, if you were trying to get every ounce of optimisation that you possibly could, it was recommended that you imported sprite images that were at the smallest possible size, then let the game engine scale them up at run time. This as opposed to saving scaled up images in Photoshop and loading those into the game.
I know that Unity has options to define the pixels per unit and scale up sprites, so would it be more optimised to load smaller images into Unity and let the engine scale it up? Or would the difference be so negligible it's almost irrelevant?
Assume the game will be going on to mobile. Thanks in advance.
Answer by hexagonius · Apr 08, 2017 at 03:28 PM
Upscaling is an optimisation in two ways: - You can fit more images into the same atlas, saving on drawcalls (batching) - the overall memory consumption on disk and memory is smaller
In general it's a good idea to keep sprites packed tight and small on mobile.
If such things as using the same sprite pixel multiple times in a row due to the screen pixels it is rendered to happen, I don't know, but I think that would be an insiginifant optimisation.
Thanks for your response! So you're saying that if I put as many sprite frames onto the same sprite sheet / atlas as possible, that's cheaper on memory than having many separate sprite sheets where possible? So if I put say all of the enemy sprites and animation onto one sheet, that's cheaper than giving each enemy its own separate sprite sheet? Is that what you mean?