Texture Formats
by David Boston · in Game Design and Creative Issues · 07/24/2007 (7:06 pm) · 3 replies
I've searched high and low and not found the answers I'm looking for...
If I understand it right, a jpg file and a png file should take the same amount of texture memory though the jpg will typically take less disk space due to the lossy compression scheme it uses.
Several places I've read that you should use jpg wherever you don't need alpha (except for terrain) and can live with the image degradation.
What I haven't found any reference to at all is the use of indexed color in png files. If you switch to a 256 color index it drops the file size dramatically while not losing pixels. Is it possible and/or adviseable to use such an indexed mode if the color quality allows? Will the footprint in texture memory be the same regardless? Will there be a processing hit due to the indexing?
Any help on this would be greatly appreciated.
Marnoch
If I understand it right, a jpg file and a png file should take the same amount of texture memory though the jpg will typically take less disk space due to the lossy compression scheme it uses.
Several places I've read that you should use jpg wherever you don't need alpha (except for terrain) and can live with the image degradation.
What I haven't found any reference to at all is the use of indexed color in png files. If you switch to a 256 color index it drops the file size dramatically while not losing pixels. Is it possible and/or adviseable to use such an indexed mode if the color quality allows? Will the footprint in texture memory be the same regardless? Will there be a processing hit due to the indexing?
Any help on this would be greatly appreciated.
Marnoch
#2
TGA is not supported by Torque.
08/05/2007 (2:25 pm)
All textures occupy the same amount of space on Video Ram unless they are DDS - AFAIK.TGA is not supported by Torque.
#3
you can use jpg instead of png - the trick is you have to provide a second jpg which is the alpha channel.
so if your color texture is foo.jpg, the alpha texture would be foo.alpha.jpg and the engine automatically loads it.
as mentioned above, they'll use up the same memory unless texture comression is turned on on the card.
08/05/2007 (3:25 pm)
Note that if you want to save on diskspace for textures with an alpha channel,you can use jpg instead of png - the trick is you have to provide a second jpg which is the alpha channel.
so if your color texture is foo.jpg, the alpha texture would be foo.alpha.jpg and the engine automatically loads it.
as mentioned above, they'll use up the same memory unless texture comression is turned on on the card.
Nick \"ShotgunNinja\" Iannone
And besides, why aren't you using Targa (*.tga) ? It's much better at compression, has a single 8-bit Alpha channel as well as 32-bit RGB channels, and it doesn't have artifacts, despite its compression level. It also loads at a relatively fast rate, and is probably the most common game texture filetype. I believe that Torque can use them.