Textures too large

I have a scene where I need to display about 20 full screen images on the iPad for the user to swipe through. The problem is that anything lower rgba32 looks blurry but when I have them set at this level it requires around 4mb per image which causes there app to crash .

Loading them as need is not an option as there is no way to no what the user will be looking at and they’ll probably be doing a lot of back and forth anyway.

Any thoughts on the best way to handle this?

You could drop it down to 3 mb per image possibly if you don’t have Alpha (i.e. RGB24).

Also you do know what they will be looking at, as you have the Scroller object to know the scrolling position and the order in which the images should be displayed on the scroller. If they’ve swiped 3 times they are on image 3. If they swipe back one they are not on image 2.
Just load up as many as you can, and load the rest when he starts moving. As they do back and forth just have a queue of needed textures and load them in a different thread (and then use Texture2D.LoadImage() in the main thread when they are done reading from file).

You could also have a lower res image that is loaded and unloaded fast and then as he sticks on the image for a short time it loads the better quality image. That way you can get many many more thumbnails all pre-loaded but not have to deal with the 80 mb of images you really need. even a quarter size image lowers the requirements to 24 mb Texture memory for the whole thing (20 mb for the thumbnails, 4 for the current image).

Um you show the images, right? of course you know what the user is looking at. You wrote the code for it. I don’t understand your comment. You could keep 3 images in memory at one time and just load the next after a swipe.

If you’re thinking of swiping through them all in one go, then compressed textures are good enough to hold in memory. You can make the compressed textures yourself using pvr tool for a higher quality tailored look, or even go with 16 bit textures, they should fit in memory just fine.

4 * 20 is 80 mb, and the ipad has 256 meg. Are you sure thats the reason for it crashing? I ask because I can load 20 x 1024x1024 textures and it doesn’t crash here on my ipad. Are you using gui textures or something weird? Quads mapped with a regular material with this texture on should work OK.

For reference, my ipad game is humming along at around 96 meg at one time, and constantly unloading and loading resources. It does happily fire a memory warning if I have other apps loaded on the ipad.

But even garageband bombs on ipad if you have a couple of other apps loaded at the same time. If its good enough for apple…

I just checked the console shows my file size to be 130mb with 125.8mb coming from textures so it should work.

The error I get from xcode when my app crashes is:

Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")

When my images are set to Rgb24 everything works fine with no errors but everything looks really ugly.

Using 130 megs can be a potential issue (keeping in mind the iPad is also running other operations on top of yours, from Springboard to Underlying Network and Camera processes, to any currently paused Apps).

On a 3GS (256 mb RAM device) we can start seeing memory warnings at 80mb, and get crashes to Springboard at around 100 mb of RAM used, though it is heavily dependent on what else is running / how long the device has been on.

I’m curious what ‘really ugly’ means, RGB24 won’t work with transparencies, but it should be visually identical to RGBA32 on solid images.

Generally I aim for half a given device’s memory as being my upper limit. I think thats sensible. Data Formatters temporarily unavailable, will re-try after a ‘continue’. (Unknown error loading shared library “/Developer/usr/lib/libXcodeDebuggerSupport.dylib”) is a weird error. Sometimes it will be due to low memory but other times it might be due to a bad file format or something else.

Can you explain how you’re loading your images?

Can you also make sure all your textures are 1024x1024? it doesn’t matter you’re only showing 1024x768.

More: http://forum.unity3d.com/threads/49602-Error-Please-Help!!!