Retina performance

Discussion in 'iPhone/iPad Programming' started by monaco7474, Mar 7, 2012.

  1. monaco7474, Mar 7, 2012
    Last edited: Mar 8, 2012

    macrumors newbie

    Joined:
    Mar 5, 2012
    #1
    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?
     
  2. macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #2
    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.
     

Share This Page