OpenGL Performance

Ive hit a bit of a roadblock and my app is starting to slow down on the older 3G iPhone. So I need to ask a few questions about openGL and corona

  1. Should we use power of 2 texture sizes as openGL likes or does it not matter?

  2. I understand that using a large 32bit png is bad as openGL will have to composite every pixel, even if some of those pixels are not transparent and that would take more time. Is this true? Im using some large images with holes cut into them, would it be better to have lots of small images, grouped, and only the ones that need the 32bit would be 32bit, the other 24bit?

  3. When an object is isVisible = 0 , does openGL ignore that object and when an object had .alpha = 0 what happens with openGL then, does it still do a pass on the image?

  4. What happens to objects when they are not on the screen? Does openGL still render them or skip them?

Phew… [import]uid: 5354 topic_id: 819 reply_id: 300819[/import]

Hi Matthew, the Iphone can display texture only with 16bit i think.

The rest of the questions I wanted to ask too.

[import]uid: 5712 topic_id: 819 reply_id: 1785[/import]

A 32 bit png (as Fireworks describes it) is a true colour png with an alpha channel on it. Exporting as a 24 bit png and you get no transparency. The iPhones draw everything fine with the 32 bit images although from what ive read they can slow down openGL a bit more than processing a 24 bit image. [import]uid: 5354 topic_id: 819 reply_id: 1786[/import]

Ok, that makes sence. I must have mixed up things then. Sorry. [import]uid: 5712 topic_id: 819 reply_id: 1787[/import]

Internally, in Corona we round up to power of 2 textures, so you don’t have to worry about that. If you have large amounts of images, you may start to run out of texture memory.

When objects are not visible, we don’t ask OpenGL to render them. [import]uid: 54 topic_id: 819 reply_id: 1805[/import]

Buzz,

not visible means not on the screen or set isVisible = FALSE? [import]uid: 5712 topic_id: 819 reply_id: 1821[/import]

also not to worry about the power of 2 textures. If I load 512px x 32px image are you rounding upto 512px x 512px as that would be a worry memory wise. [import]uid: 5354 topic_id: 819 reply_id: 1824[/import]

They needn’t be square. [import]uid: 54 topic_id: 819 reply_id: 1825[/import]

isVisible = false [import]uid: 54 topic_id: 819 reply_id: 1826[/import]