Game Development Community

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?
Page«First 1 2 Next»
#21
11/29/2008 (8:08 pm)
These options are not really sufficient.

Option 1 doesn't work as there is no program (that I or anyone else on this forum is aware of) that can create a 16bit PNG. I would be very grateful if someone could correct me on this. For option 1 to work we need the iTGB editor to read .PVR textures created with this tool: www.imgtec.com/powervr/insider/powervr-pvrtextool.asp

Option 2 is no good because it is global. We need to be able to flag individual textures as 32 bit. Leaving all textures as 32 bit is not efficient.

My suggestion is that for the next version of iTGB, all PNG textures should be left as 32 bit (or 24 bit if they have no alpha channel). The editor should load and display .PVR textures for 16 bit or PVRTC texture formats.

Automatically converting PNG textures to 16 bit should not happen - as the results are poor (as shown in the images above). This is fine as a first pass hack to get the engine working, but it should not be left in future versions.
#22
11/30/2008 (12:02 am)
I don't know if this will help, I am just a lowly programmer with little to no technical art experience. So what you guys are taking about here is a bit new to me.

But I have used Krita and cinepaint, and they are fond of stating that they support 8 16 and 32 bit color channels. Which I think is what you guys are talking about here. :)

Let me know if I misunderstood what you guys are talking about.
#23
11/30/2008 (1:25 am)
Christopher - actually, when Cinepaint and Krita say 16 bit image modes, they mean 16 bits per channel, which is better quality than the normal 8 bits per channel image. 8 bits per channel can make a 24 bits per pixel image (8 bits in each of the RGB channels) or 32 bits per pixel (an additional 8 bit alpha channel for transparency).

For iPhone, we need a 16-bit per pixel image, which can be broken down to various different 'bits-per-channel' types, RGB 565, RGBA 5551 or RGBA 4444.

I only know of 2 ways to make such an image. One is to export a .dds from photoshop with the Nvidia texture plugin. The other is to use the PowerVR texture tool to create a .pvr texture. Neither of these image formats are currently supported by iTGB. DDS wouldn't be a good choice anyway, as it uses lossy compression.
#24
11/30/2008 (3:22 am)
Please reread my option 1: using 8bit png
That is present and works as mentioned further up by a different user.
#25
11/30/2008 (4:37 am)
Marc - I don't understand what you mean by "go to 8bit where you have full control." You do not have full control over the in-game appearance of 8-bit images as the automatic compression can result in banding.
#26
11/30/2008 (10:20 pm)
@Conor
8 bit pngs are 256 color palletted pngs and are currently supported by iTGB. You can have 200 blues and 55 whites/grays and 1 transparent for your blue button image.
We have the PVRTC and 24/32 bit images supported in iTGB and will be releasing it shortly.

www.puap.com/gg_forums/button_blue_256.png
Paul
#27
11/30/2008 (10:40 pm)
Thanks for clearing that up Paul - I misunderstood 8-bit png to mean 8 bits per channel (ie true color), not palletized! I never knew palletized images were supported.

How did you make this image? If I load it into Photoshop it is corrupted, and if I try to save a 256 color png from Photoshop (using the SuperPNG exporter) it crashes.
#28
12/01/2008 (5:10 am)
I used photoshop to convert 32bit into 8bit images through Save For Web... instead of Save As and it does let you create 8bit png. it will also get rid of the banding. however , it you have an image with many colors it won't look so good. for the blue button it will look good, but you will get upset with other images, prepeare for disapointment. right now I've learned to live with it, but I can't wait for the PVRTC. I've already downloaded their plugin and converted my images and they look way better than the 8bit png. I am about 2 weeks away from finishing my game and preety much counting on replacing all my 8bit png's.
#29
12/02/2008 (5:23 pm)
Here is what we have come up with as a compromise for the next release of iTGB.
There is a pref variable called
$pref::OpenGL::force16BitTexture
If this is set to true (1) then all paletted PNG files will be set to 16 bit. If set to false (0) all PNGs will be 24/32bit.
All PNG files that are 24/32bit will be displayed as 24/32bit no matter what the setting is.
This works for PC, MAC and iPhone builds so you can see the results on your desktop before going to the iPhone itself.

The thought here is, if you are running low on texture memory then you set this flag and all paletted (8 bit) PNGs will be automatically converted to 565, 5551 or 4444.
If you absolutely need your blue button to not have bands and be true color blue, use a non-paletted PNG file.

The PVRTC has _lots_ of artifacts especially when alpha blending is involved and there are several parameters you will probably need to tweak to get it to look just right, so be aware of that. It works better as solid textures for 3D objects instead of 2D sprite textures. It will most likely work well for background images and special fx or things that do not need exact pixel placement.
#30
12/03/2008 (3:29 pm)
Update:

Paul meant to say that the variable is:
$pref::iPhone::ForcePalletedPNGsTo16Bit
the OpenGL pref was a different variable Torque used before.
#31
12/03/2008 (4:32 pm)
Thanks guys, that sounds like a great solution.
Page«First 1 2 Next»