- Home /
How expensive is scaling in 2D unity? Is it better to pre-scale?
I'm sketching out my 3D looking 2D game so I can prepare myself code-wise and I have a question. As you can see in the image below, the group of orcs is made of only two re-scaled sprites https://www.dropbox.com/s/50t3zw3t9fz27bw/optimized.png?dl=0
My question is, how expensive is scaling in terms of performance? Is it better to have a single sprite as big as the biggest sprite I'm gonna need and then scale it in code, or is it better to have one sprite for each of the sizes I'm gonna need? In case it's relevant, I estimate I'm going to need something like 15-25 characters, with 3-7 animations each and each animation is going to have 2 versions, one for each angle.
Answer by KristianBalaj · Jun 24, 2015 at 07:57 PM
Yes, better is when you scale your sprites for example in photoshop so big how you need in your application and then not scaling sprites in Unity, to save performance.
Thanks a lot for your answer! Would it be possible to use one camera with a different size for each of the rows the characters walk in? Or a 3d camera and adjusting z values?
If you are trying to mimic a 3d environment with proper scaling etc for the sprites then I would go with the last option you mentioned.
Simply use a 3d camera and move the sprites in all three axis - scaling and rotation will automatically be handled and you won't have any weird batching problems.
Great, thanks a lot! This will really help keep down the final game size, compared to having to re-scale them in Photoshop