- Home /
Long looping animated backgrounds in a 2D game.
I have ambitious plans for having a looping but fairly long animated background, I'm talking 5-10 seconds loop, so we are talking 240 background images in the least.
I'm just wondering, if this is possible, where do the textures go in a 2D unity project? the ram? or the gpu ram? what about laptops that have hardly any gpu ram, does unity know to put it into the ram instead.
And is it possible to even play 24 hi res images per second (remember again, I'm not talking 1meg+ pngs, but jpegs that will be around 200k per image.)
Is this just a totally stupid idea overall? i can accept that as the answer if it is.
PNG or JPEG (or anything else) is completely irrelevant since Unity never uses source images. They are only for importing into Unity. Once imported, the texture settings are all that matter (truecolor, 16-bit, etc.).
It will be for pc only.
I pretty much knew it would be impossible for iphone and android.
Still it sounds like a tough job, especially as ill want it to be playable on most 3 year old and newer laptops too.
I think I'll give it a miss on this idea then.
thanks for your input :)
Answer by ZenithCode · Apr 26, 2014 at 05:49 PM
I'm not a pro in this but I'll give it a shot.
AFAIK, the images will be loaded to the GPU Ram. So, in my opinion this is a bad idea because 200K Jpeg takes much more than that in memory.
E.g. If the texture is POT, lets say 1K *1K texture - this will take:
4Mb with no compression - 960Mb total
2Mb if 16-bit compression is used - 480Mb total
Approx 0.5Mb -1Mb if you use ETC (Android) or PVR (iOS) - 240Mb total
If you plan to have this running on mobile devices, its a definite no-no. If its for PC and you can use compression, than it might be OK.
**Converted to 'Answer' as I see that @Eric5h5 said the same thing regarding memory footprint.
Your answer
![](https://koobas.hobune.stream/wayback/20220613143628im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is operating using GetRawTextureData faster that doing SetPixel/Pixels? 2 Answers
Using baked textures and about texture sizes? 1 Answer
Fastest way to draw a grid of textures 2 Answers
Better performance? GUITextures or Texture2D drawn in function OnGUI? 0 Answers
Draw tilemap with Texture2D.SetPixels: Performance and Memory? 0 Answers