I'm looking for some advice on how to structure my texture loading architecture and memory management. I'm planning to rip things apart and benchmark them and do lots of work, but I'm hoping that a little expert wisdom can set me on the right path first.
My app has a ton of different textures of two different types. There are plenty of the usual type: normal, small-ish user interface textures like buttons, particles, glows, backgrounds, etc. But there are also 388 of these monster "stroke" textures (strokes of Chinese characters), of which 5-20+ are active at a time. They're typically 75px - 300px on a side (double for retina), and it looks like I can only fit 20-30 in an atlas, so it would take around 15 atlases to cover them all. I don't think they would fit in memory, either. I have them as white-and-transparent PNGs right now (haven't tried PVR yet), and I'm using a ton of memory trying to keep just 20 of them loaded to display one Chinese character at a time.
Rendering performance seems to be okay, but every time a new stroke appears or we switch characters and may need a whole new set of strokes, there's a slight pause. I will profile more to make sure, but I think this is happening when I go to disk to load the texture from the image file again. When memory is low (like when a tester has a fully loaded device before a restart), performance really sucks, so I'm guessing this is happening a lot even in the middle of writing a character, where there's not enough memory to keep even one characters' strokes loaded. (After a device reset, performance is fine.) I'm currently evicting all stroke textures when I get a memory warning, so I think this is what's going on.
So I plan to try compressed PVR textures, although I doubt they will look good enough (the stroke edges need to be very crisp). Apart from that, what else should I try? Am I correct in guessing that texture atlases (for the strokes, at least) would be unworkable in this situation (I wouldn't have enough memory to be able to keep them all loaded)? OpenGL texture switches don't seem to be the worst thing for this app, but rather texture thrashing trying to maintain a working set with too-frequent file loading.
Thanks for any advice! I'd also like to mention that Sparrow is awesome. I'm getting great results visually, especially from the particle system and various rendering hacks implemented based on tips I read on this forum.