PDA

View Full Version : Retina performance




monaco7474
Mar 7, 2012, 08:15 PM
Hello, all.

Do you have any tips for increasing performance for retina?
I don't use any well-known game engine, but just made it by myself with opengl 2.0.
Without applying retina, the fps is good(up to 60), but if the contentsScale of eagl layer makes double for retina, the performance decreases by -20fps:(

Can anybody give me any tip?



seepel
Mar 10, 2012, 11:11 PM
Do you have a large background? Loading and drawing a large texture can really cause a hit in performance. You can try drawing the background with a lower memory footprint color space like RGB565. It can also help to either break up your background image into multiple images that are all a power of 2, or make use of a texture atlas. When using openGL remember that whatever the dimensions your original image is the length and width will be rounded up to the next power of 2. For example an image that is 257x257 will actually take up the memory of an image that is 512x512.

Another graphics hit can occur if you have a lot of alpha pixels in your textures.

Finally if you simply have a lot of repeated textures to draw you can think about drawing them all at once rather than individually (often known as batch drawing?).

And finally I can't recommend cocos2d enough, it takes care of a lot of this for you.