Texture Packer and Corona

Hello guys,

I am using Texture packer to create rgba4444 and rgb565 pvr textures for use in Corona.

I am using a recent Macbook (Core 2 Duo, Nvidia 9400) updated to the latest OSX (10.6.7). I am using the latest build of Corona, and I am developing for iPod Touch 4th gen. Plus i have installed the latest iphone SDK.

  1. I input a 512x512 sprite sheet with alpha into TP.

  2. for output settings, I use the following:
    Data format: Corona TM SDK
    Data file: auto generated
    Texture Format: pvr
    Image format: rgba4444 or rgb565
    Texture file: auto generated
    Dithering: Floyd Steinberg with alpha
    Premultiply alpha: NO
    AutoSD: NO

  3. I hit the publish button, and the pvr texture is generated correctly (both as shown by Texture Packer PVR viewer and by the PowerVR PVRTC viewer). The texture size is 512x512, it retains alpha… it´s exactly as I need it.

  4. I move the texture into my project root folder (where I have been working with PNGs up to now with no problems.

  5. I change the code accordingly to use the new pvr textures

But then the pvr textures do not load in the simulator (PNGs load fine, though). There are no warnings or errors at build time or when compiling for the ipod. The game actually compiles, and I can load it, but when I reach the portion of the game where I used the pvr (for testing) the game goes down in flames.

What am I doing wrong? Any help is appreciated!

Thanks!

Eduardo [import]uid: 31682 topic_id: 8428 reply_id: 308428[/import]

Corona doesn’t support pvr textures. [import]uid: 12108 topic_id: 8428 reply_id: 30193[/import]

Hi!

Thanks for the reply!

Hmm… what a pity… Since I saw a lot of talk about how awesome pvr was in some other posts in these forums, and since I hadn´t seen any mention indicating support or lack thereof, I thought it was supported.

Things being as they are, do you know if i use pngs, do they retain their 16 bit compression (rgba4444 or rgb565) at runtime or do they load as full rgba8888? [import]uid: 31682 topic_id: 8428 reply_id: 30197[/import]

Compression for pngs only applies to the file stored on disk; in memory that gets expanded to uncompressed data.

That’s the whole point of PVR compression; it’s the format provided by PowerVR for compressed images on their graphics chips, and iPhones use PowerVR chips. In other words, those stay compressed in memory.

Things is, PVR textures only work on PowerVR chips and Corona is cross-platform. Although all current iPhones use PowerVR chips, the only Android devices using PowerVR chips are Motorola Droids.

Anyway, PVR can have some nasty surprises, so they’re not as awesome as some people think. For starters, it’s a very lossy file format, so the images turn out looking similar to GIF. If you think about web graphics, carefully crafted GIFs can look good but overall PNGs look better with less effort. [import]uid: 12108 topic_id: 8428 reply_id: 30200[/import]

Oh well…

Thanks for your reply jhocking!

How sad… actually we bought texture packer because it did some dithering algorithms that created really good results when converting to 16 bit textures.

Maybe it would be a good for users if Ansca noted that caveat in their blurb for texture packer…

I would like to pester you with one more question. We were trying to go under this 24mb texture limit for the sgx535 that we have been hearing about. Does the iPhone GPU really have this limitation or is it more of an urban legend? [import]uid: 31682 topic_id: 8428 reply_id: 30205[/import]

I don’t know of any 24MB texture limit. Is that referring to the total of all loaded textures or a limit on any single texture? Neither situation makes sense, just curious. The total texture memory is definitely much higher than that (I think 256MB on iPhone 3Gs) while no single image would be anywhere close to that. [import]uid: 12108 topic_id: 8428 reply_id: 30206[/import]

Hi!

Yeah I´ve read in some other forums this particular number of 24 mbs for your total texture buffer. Some people say that if you exceed this number you will start chewing up main memory instead of dedicated texture memory, thus degrading performance significantly.

So we have gone through the pain of having ALL our textures hover right below that number at any given moment during the game (except in menus, where super performance is not a concern).

Oh boy, well, it would seem then that we have been putting a lot of effort into nothing. :frowning: [import]uid: 31682 topic_id: 8428 reply_id: 30209[/import]