Hi i wonder how many textures/textureAtlases can be used in runtime and where exactly they are stored: in gpu memory or in ram memory?
where texture are stored?(7 posts) (6 voices)
It depends on how much memory is avaliable. In GPU memory.
i have read somewhere that it gives priority to the ram memory
Both actually if you don't dispose the source, since the underlaying bitmap data is stored in RAM and then it is uploaded to GPU memory. Bitmapdata is kept in RAM to handle situations like device loss.
Anything that is drawn onto a screen needs to be in GPU memory you can't draw stuff that isn't in GPU memory
Exactly! If the bitmap data stays in RAM can be configured using "starling.handleLostContext". On iOS and OS X, it's not necessary (they don't ever lose the context), but on Android and Windows, it's required to activate it.
In mobile project how many texture atlses (2048x2048) can be used in the same time? What is a good practice for that?
Depending of your device but of course less you have, more good it is. The best practice is to remove the unused texture atlas.
For example if you use one texture atlas for your home(button/background/etc), when you launch the game scene, remove texture atlas used for the home and load textures atlas of your game, etc..
I hope it will help you.
You must log in to post.