Performance improvements large scrolling backgrounds

I’m trying to make a scrolling background with large transparent textures (something like 1024x1024).

I’ve got 5 different layers composed of 2 tiled images each and I notice performance issue on device which is normal because I guess moving large transparent textures is a heavy task (can you confirm this?). My question is what can I do to optimize my game?

I’ve already put each layer in snapshots so that I don’t scroll 2 large images for a layer but only one big (does it help or not at all ?).

Would it help the image not bein transparent? (just a teoritical question because I need transparency but the answer is interesting me).

I wouldn’t think transparency should have any effect on moving an image.  Most devices are not square, so your images might be bigger than they need to be. But moving 5 layers of big images might be quite a bit of pixels to be shuttling around.

Rob

you may just be running up against the total fill-rate of your GPU

ie, “moving” may have nothing to do with it.  q to ask yourself:  prob still exists if you DON’T move them?

As far as openGL is concerned a pixel is a pixel whether it has any colour data associated with it or not - {1,1,1,1} is the same as {0,0,0,0}.

As Dave points out you will need to test whether the performance is the same with/without movement to determine whether fill rate is your issue - I suspect in your case it will be.

If you have 5 layers and each layer has a 1024 x 1024px image in it that is a total of 20MB total (1024 x 1024 x 4 x 5). 

You could try using 512 x 512px and scaling by 2 as this would quarter your memory requirements and may be acceptable looks-wise. 

Another trick is to build your background out of much smaller images and then tessellate and transform them.  The overhead to scale, rotate and transform is minimal compared to loading the texture.  Parralax techniques may also help.

I wouldn’t think transparency should have any effect on moving an image.  Most devices are not square, so your images might be bigger than they need to be. But moving 5 layers of big images might be quite a bit of pixels to be shuttling around.

Rob

you may just be running up against the total fill-rate of your GPU

ie, “moving” may have nothing to do with it.  q to ask yourself:  prob still exists if you DON’T move them?

As far as openGL is concerned a pixel is a pixel whether it has any colour data associated with it or not - {1,1,1,1} is the same as {0,0,0,0}.

As Dave points out you will need to test whether the performance is the same with/without movement to determine whether fill rate is your issue - I suspect in your case it will be.

If you have 5 layers and each layer has a 1024 x 1024px image in it that is a total of 20MB total (1024 x 1024 x 4 x 5). 

You could try using 512 x 512px and scaling by 2 as this would quarter your memory requirements and may be acceptable looks-wise. 

Another trick is to build your background out of much smaller images and then tessellate and transform them.  The overhead to scale, rotate and transform is minimal compared to loading the texture.  Parralax techniques may also help.