views:

1536

answers:

2

im animating an 89 frame png sequence, that has been cut down to half by putting two frames per 512 x 512 frame. but im having major image qaulity issues (lossy)

does anyone know of a good way to animate an 89 frame animation, without losing quality or chugging the processor?

all the best.

A: 

I'm doing a similar project using cocos2d. Your images may look better if you do one image per texture or possibly try RGBA 4444 format.

But if you do use cocos2d, it's pretty straightforward. Once you've downloaded cocos2d, there's very good example code.

http://www.cocos2d-iphone.org/archives/61

John
+2  A: 

PVRTC will definitely make your image look lossy, but there are ways to get around that. Using a texture atlas can help, because PVRTC typically messes up the edges of the image the most, as well as causing issues with transparency. I'd also try turning off any mipmap filter you have (both nearest and linear filters but especially nearest, when combined with PVRTC, can make it look significantly more blurry) and try turning on a linear texture filter, which will blend everything so that the loss is less apparent and things only look slightly blurry. You can also save your images larger than you draw them (i.e. have a 512x512 image that is compressed with PVRTC, but draw it at 256x256). 2BPP PVRTC will cause the texture to take up 1/8 as much memory as RGBA 4444, so even increasing the size like that (to take up 4x as much memory) will give you a savings of 2x. If you're just going with 4BPP, however, you might as well just go with RGBA 4444 if you need to resize your image by double.

For larger images that need to be more detailed, PVRTC is typically not a great strategy. For icons and the like, you can see significant savings, especially because you can get away with drawing them much smaller.

Mipmaps are made like this (don't do this):
glGenerateMipmapOES(GL_TEXTURE_2D);

And you can turn on a linear texture filter like this:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

You definitely don't want to do this, either:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);

Eli