Using large transparent pictures as texture atlases

Posted by azlisum on Stack Overflow See other posts from Stack Overflow or by azlisum
Published on 2011-11-20T11:23:51Z Indexed on 2011/11/21 1:51 UTC
Read the original article Hit count: 136

Filed under:
|

i'm new to android programming and i'm trying to create a relatively big 2D game. I have to use lots of images and objects in my game so I decided to use OpenGL ES. I have several texture atlases, all of them saved as png's because of the transparency. I also know, but i'm not sure why, that I have to use images, which height and width is multiple of two. I test my game on an old HTC Hero running Android 2.3.3. When my picture atlases are 512x512 each, my game has a frame rate of between 50 to 60 fps. When I use 1024x1024 non transparent png, there is no problem - the FPS is again between 50 to 60 fps. But when i decide to use a 1024x1024 transperent PNG's my frame rate drops to 4,5 fps. Could this be a problem related to the age of the device i'm using for testing? These are the OpenGL functions I use each loop to draw batches:

    gl.glEnable(GL10.GL_TEXTURE_2D);
    gl.glEnable(GL10.GL_BLEND);
    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

    //drawing happens here

    gl.glDisable(GL10.GL_BLEND);

Thanks in advance :)

© Stack Overflow or respective owner

Related posts about android

Related posts about opengl-es