- Home /
Best way to manage hundreds of materials?
I'm working on a game for iOS, and I need to make use of hundreds (probably 200 or so) of unique images. I've had them compressed down to 512x512 4bit PVRTC (so they're 128 kB).
I've created a generic scene that I can populate, and I've stuck all of the materials into a Resources folder.
Needless to say, it's a huge memory hog when I run it on a device (iPhone 3GS) and it's become a major headache/problem for me. Is there a better way (less memory-intensive) for me to go about doing this?
Answer by fantazm · May 10, 2011 at 06:42 AM
To be able to give you the best answer you should describe more precisely what you are trying to achieve. What are the 200 images? Are they symbols or textures. Why do you need 200? Do they need to be in 512 resolution? Are you making optimal use of the texture space? Maybe you can you combine several textures into one bigger texture.
If you target a pre-3GS the maximum texture size is 1024, after that it's 2048
The images are pictures of real-world items that are presented to the user in batches of up to 12 (in addition to other 2D game assets). I suppose they don't need to be 512x512 (256x256 $$anonymous$$imum though, I feel)..
They're always going to be displayed flat towards the camera (like a GUITexture).
Would having several scenes with the materials pre-loaded provide better performance than populating them at runtime from the Resources folder?
Can you combine the images in bigger textures in sets of 12. That would probably save you a lot of valuable texture space.
I don't know if pre-loading them in several scenes would give you the performance boost you are looking for. As the iPhone would still have to juggle the textures in memory.
$$anonymous$$aybe someone else has a better suggestion but I would go for combining the pictures in bigger texture sheets.
Your answer
Follow this Question
Related Questions
Memory problem. How do I dump a Streaming Asset from memory? 1 Answer
Loading a Random Resource in a Folder Without Using Resources.LoadAll 0 Answers
Memory overhead associated with assets in Resources 0 Answers
memory consumption when changing materials [iOS] 2 Answers
[iOS] Can I include "Data" folder in resource when downloading resource? 0 Answers