Texture banding artifacts / compression?
by Eyal Erez · in iTorque 2D · 11/06/2008 (3:58 pm) · 31 replies
I've noticed that textures with similar color values, gets "banding artifacts" .
I loaded the same texture as a photo to the iPhone and it looks great, so I figure it must be related to iTGB.
Any suggestions?
I loaded the same texture as a photo to the iPhone and it looks great, so I figure it must be related to iTGB.
Any suggestions?
#2
I did 8 bit and it definitely solved the banding. I would have prefered 16bit though, what format do you use?
So do I need to go ahead and convert all my textures? why doesn't it like 32bit?
11/06/2008 (7:52 pm)
So photoshop 7 only lets you convert to 8 bit png, not 16bit. I did 8 bit and it definitely solved the banding. I would have prefered 16bit though, what format do you use?
So do I need to go ahead and convert all my textures? why doesn't it like 32bit?
#3
You end on 16bit in any case, so you have to design them with only those 16bit in mind.
Thats why the 8bit works.
can't give you an idea on a usefull format thought. BMP is the only that springs to my mind for 16bit and on the iphone its not really the preferred format if it works at all (don't think so)
so the png8 seems like a reasonable solution
11/07/2008 (2:06 am)
The iphone has no 32bit, thats the problem.You end on 16bit in any case, so you have to design them with only those 16bit in mind.
Thats why the 8bit works.
can't give you an idea on a usefull format thought. BMP is the only that springs to my mind for 16bit and on the iphone its not really the preferred format if it works at all (don't think so)
so the png8 seems like a reasonable solution
#4
At least the 8bit got rid of the banding.
Thanks for the info.
11/07/2008 (7:54 am)
Yes, I tried 16bit bmp and it did not like that at all.At least the 8bit got rid of the banding.
Thanks for the info.
#5
As I currently "don't care" for the end results quality on the iphone (its dummy media anyway) I've not worked much with the media related end so far. But I think it was somewhere mentioned as beeing a flag.
changing the defined compiler flag in the torqueconfig thought doesn't seem to be the answer, at least it didn't compile anymore for me after a short test.
11/07/2008 (8:02 am)
Or the apple png format ... you might have to check the project settings that currently disable apples png conversion on pngs you add. I think the default is that your pngs go untouched onto the iphone (one of the devs might have to correct me here)As I currently "don't care" for the end results quality on the iphone (its dummy media anyway) I've not worked much with the media related end so far. But I think it was somewhere mentioned as beeing a flag.
changing the defined compiler flag in the torqueconfig thought doesn't seem to be the answer, at least it didn't compile anymore for me after a short test.
#6
There is a -skip-PNG compile flag way at the bottom of your Xcode project that enables/disables Apples png optimize step.
We are adding PVRTC compressed format as well, but you will probably not want to use these for your main characters as they are lossy compression.
11/11/2008 (12:27 pm)
Currently iTGB is using 16 bpp formats for images, 5-6-5 standard, 5-5-5-1 for transparent and 4-4-4-4 for alpha. 24 bit images get converted to 16bit internally so it would be better to convert them externally in a tool.There is a -skip-PNG compile flag way at the bottom of your Xcode project that enables/disables Apples png optimize step.
We are adding PVRTC compressed format as well, but you will probably not want to use these for your main characters as they are lossy compression.
#7
11/21/2008 (7:37 pm)
Why can we not use 32bit .pngs? Are they just not supported by iTGB yet? 4 bits per channel is making some of my sprites with smooth gradients in them look nasty.
#8
but the iPhone does not support 32Bit so you get degraded performance and potentially undesired color replacements as they will have to be converted in realtime.
11/22/2008 (6:54 am)
You can use 32bit pngsbut the iPhone does not support 32Bit so you get degraded performance and potentially undesired color replacements as they will have to be converted in realtime.
#9
I'm very new to tgb/itgb, and just reading through the forums and doing some initial tests with the builder. Liking what I see so far, even with the teething issues we've been warned about ; )
I stumbled across a Photoshop plugin that seems to offer 16bit png exports. It installs & seems to export fine, not tested within the builder/simulator yet, thought I'd post incase its usefull for others here. See if it works for you...
http://www.fnordware.com/superpng/
Phil.
11/22/2008 (2:50 pm)
Hi guys,I'm very new to tgb/itgb, and just reading through the forums and doing some initial tests with the builder. Liking what I see so far, even with the teething issues we've been warned about ; )
I stumbled across a Photoshop plugin that seems to offer 16bit png exports. It installs & seems to export fine, not tested within the builder/simulator yet, thought I'd post incase its usefull for others here. See if it works for you...
http://www.fnordware.com/superpng/
Phil.
#10
Photoshop has some seriouly nasty issues with alpha channels in PNG in most editions (I think pre CS3)
11/22/2008 (3:04 pm)
That exporter is suggested anyway for PNG in PhotoShop :)Photoshop has some seriouly nasty issues with alpha channels in PNG in most editions (I think pre CS3)
#11
Can anyone tell me how to save a 16-bit png with Photoshop? I have the superPNG plugin and Photoshop CS3. I'm using the 0.8b version of SuperPNG (as this is the one with correct alpha channel support).
Or can someone explain how I set the -skip-PNG compile option in Xcode so I can try out my 32bit PNGs? When I search for that in Xcode I get this comment:
"//PUAP -Mat uless you compile with a custom build step 'IPHONE_OPTIMIZE_OPTIONS' set to '-skip-PNGs', you're PNGs will be altered(optimized)".
I'm not very familliar with Xcode, how do I compile with this custom build step?
11/22/2008 (11:15 pm)
Marc - I was at the iPhone tech talk in Melbourne on Friday and they said that the iPhone does display 32bit images, however 16bit is recommended to save memory.Can anyone tell me how to save a 16-bit png with Photoshop? I have the superPNG plugin and Photoshop CS3. I'm using the 0.8b version of SuperPNG (as this is the one with correct alpha channel support).
Or can someone explain how I set the -skip-PNG compile option in Xcode so I can try out my 32bit PNGs? When I search for that in Xcode I get this comment:
"//PUAP -Mat uless you compile with a custom build step 'IPHONE_OPTIMIZE_OPTIONS' set to '-skip-PNGs', you're PNGs will be altered(optimized)".
I'm not very familliar with Xcode, how do I compile with this custom build step?
#12
Also, check TorqueConfg.h and make sure you USE_APPLE_OPTIMIZED_PNGS #define matches(if you do add the -skip-PNG, do not define it).
the build setting tells the XCode not to fiddle with our PNGs when copying them to the Bundle, and the #define tells Torque to load the PNGs differently because they have been fiddled with, so they should be opposite.
11/26/2008 (11:17 am)
Under the Target option page in your XCode project, at the very bottom, add the build setting "IPHONE_OPTIMIZE_OPTIONS=-skip- PNGs" (minus the quotes)Also, check TorqueConfg.h and make sure you USE_APPLE_OPTIMIZED_PNGS #define matches(if you do add the -skip-PNG, do not define it).
the build setting tells the XCode not to fiddle with our PNGs when copying them to the Bundle, and the #define tells Torque to load the PNGs differently because they have been fiddled with, so they should be opposite.
#13
Thanks!
11/26/2008 (1:20 pm)
@Marc Schaerer: I too have downloaded superPNG and can not figure out how to save 16 bit PNGs. How do you do this? I've looked all over the net and have found numerous references to the tool but no instruction on how to use it. Any help/insight would be GREATLY appreciated! Thanks!
#14
The main difference is that it exports the data as correct png unlike the photoshop own plugin that has problems. especially if alpha has been used, the export is pretty borked and shows banding issues and other things.
11/26/2008 (2:23 pm)
SuperPNG exports what you give it.The main difference is that it exports the data as correct png unlike the photoshop own plugin that has problems. especially if alpha has been used, the export is pretty borked and shows banding issues and other things.
#15
11/26/2008 (4:52 pm)
I think what Warthog is asking (along with me) is how does one create a 16-bit image, ie 4 bits per channel with alpha? Photoshop does not appear to be capable of creating such an image. Is there a recommended process for generating 16bit images so that they don't get automatically crunched when we build the game?
#16
4bit per channel does not exist. It would be 5 5 5 1 or 5 6 5 to be hardware compliant. There does nothing exist like alpha gradient + 16bpp.
16Bit in total is at best a job for BMP.
SuperPNG solves issues with the colors, created by the regular photoshop png exporter since at least PS6
16Bit images by the way don't solve the main problem: RAM size as they expand to the same format as 32bit bmp
If you want lower memory footprints and higher performance you will have to wait until iTGB supports PVRTC where you can get 4bpp / 2bpp or dive into the iPhone SDK and iTGB sources and add it yourself.
11/26/2008 (6:48 pm)
You don't4bit per channel does not exist. It would be 5 5 5 1 or 5 6 5 to be hardware compliant. There does nothing exist like alpha gradient + 16bpp.
16Bit in total is at best a job for BMP.
SuperPNG solves issues with the colors, created by the regular photoshop png exporter since at least PS6
16Bit images by the way don't solve the main problem: RAM size as they expand to the same format as 32bit bmp
If you want lower memory footprints and higher performance you will have to wait until iTGB supports PVRTC where you can get 4bpp / 2bpp or dive into the iPhone SDK and iTGB sources and add it yourself.
#17
11/26/2008 (7:37 pm)
Thanks for your replies Marc, but I still don't see how you can create a 16bit image in Photoshop, or any other program. How do you create a 5551 image, or a 565 image?
#18
But if you export correct 8888 images (means SuperPNG exported PNG) you don't have the banding problem
11/27/2008 (5:35 pm)
I don't know of any program. This is normally done after loading 32Bit data into your RAM and then instruct the graphics API to create a 5551 / 565 texture from it.But if you export correct 8888 images (means SuperPNG exported PNG) you don't have the banding problem
#19
11/27/2008 (8:49 pm)
On the left is a 32-bit PNG saved from Photoshop CS3 using the SuperPNG plugin. On the right is a screengrab from my game running on the iPhone hardware. As you can see, the banding on this image is very bad. It would be great if there was some tool for previewing how a 32-bit image will be quantized before seeing it in game. As it stands I have no control over the color selection and thus can't influence the banding. The only fallback seems to be to turn off 16-bit color mode completely, which will greatly reduce the performance of the game.
#20
1. Go to 8bit where you have full control
2. Alter the compilation flags to preserve your textures
11/28/2008 (5:12 pm)
The options are:1. Go to 8bit where you have full control
2. Alter the compilation flags to preserve your textures
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft