I have a 32x gray animation of a diamond exploding into pieces (i.e. 32 PNG images @ 1024x1024)
my game consists of 12 separate colors, so I need to do the animation in any color I want
This, I believe, excludes any Apple structure, it also excludes a lot of common code for animating frame-by-frame in iOS.
What are my potential solutions?
these are the best SO links I've found:
that the latter shows that it may be possible to load the image into the GL texture of each frame (it does this from the camera, so if I have everything that is stored in memory, it should be even faster)
I can see these parameters (the list of the laziest, the most optimized last)
option A each frame (kindly provided by CADisplayLink), loads the corresponding image from the file into the texture and displays this texture
I'm sure this is stupid, so on option B
option B preload all images into memory then, as described above, only we load from memory, not from a file
I think this will be the perfect solution, can someone give him thumbs or thumbs down?
option C preload all my PNGs into a single GL texture of maximum size, creating an Atlas texture. each frame, set the texture coordinates to a rectangle in the Atlas for this frame.
while this is a potentially perfect balance between coding efficiency and work efficiency, the main problem here is loss of resolution; on older iOS devices, the maximum texture size is 1024x1024. if we interrupt 32 frames into this (actually it is the same as cramming 64), we will have 128x128 for each frame. if the resulting animation is close to the full screen iPad, this is not going to crack it.
option D instead of loading into one GL texture, load a bunch of textures in addition, we can compress 4 images into one texture using all four channels
I am afraid that simple coding is required here. My RSI starts to stutter, even thinking about this approach
I think I answered my question here, but if someone really did it or can see the way, answer!