TGA vs. PNG vs DDS for transparent textures

Posted By: Schloder87

TGA vs. PNG vs DDS for transparent textures - 07/19/12 15:34

Hey guys,

i have an important question to you. What is better for transparent textures (with alpha-parts in it)

What is to prefer? TGA, PNG or DDS? Is there a difference between sorting? I know that DDS is the most efficient regarding to memory.

Regards

Markus
Posted By: gamers

Re: TGA vs. PNG vs DDS for transparent textures - 07/19/12 16:01

DDS is the best solution with alpha-parts...
Posted By: HeelX

Re: TGA vs. PNG vs DDS for transparent textures - 07/19/12 16:34

I never used PNG, but one feature of it is, that it can save alpha masked parts without a needed background, which makes them easier to create, or better said, the quality is better without manual postprocessing of the texture.

Otherwise, I would always prefer TGA because it is more common for game engines, but maybe that oppinion is driven because I am used to it.

TGA and PNG have the huge advantage, that they are losless. DDS has huge artifacts when it comes to smooth color transitions, like abstract gradients (e.g. from white to grey on big textures). They are best suited for structured texture with lots of detail and colors, but suck in special cases like gradients.

Alpha is treated seperately from RGB channels in the DDS compression process, but the alpha mask sucks as well on huge transitions, like going from 100% to 0% alpha over a long distance. Another thing is that blocks of 4x4 pixels are compressed, could produce artifacts in border cases.

So, in cases where dds compression sucks, you should always use lossless formats like tga or png.

But in the end it highly depends on your textures and how they "are" and how you --preceive-- the compression artifacts. If you dont like them - use tga/png.

Another case is cutout alpha, in that case I would always advise to use DXT1 (DDS) compression, unless the RGB compression sucks again wink
Posted By: Superku

Re: TGA vs. PNG vs DDS for transparent textures - 07/19/12 16:51

I fully approve of HeelX's response, only a little additional information:

Originally Posted By: Manual
PNG-Bilder verhalten sich wie 32-Bit-TGA-Bilder mit Alphakanal (auch wenn der Kanal im Paintprogramm nicht explizit erstellt wurde. Sie werden aber, da sie nicht von der Engine, sondern von der DirectX-Bibliothek geladen werden, nicht empfohlen. Es gibt keine Garantie dafür, dass sie automatisch wiederhergestellt werden, wenn das Videogerät verloren geht. Das bedeutet, sie können ihren Inhalt verlieren wenn z. B. eine Vollbildanwendung minimiert wird.
------
PNG images behave like 32 bit TGA images with alpha channel (even if the channel was not explicitly created in the pain program). They are not recommended because they are loaded not by the engine, but by the DirectX library, and are not guaranteed to be automatically restored when the video device gets lost. This means that they can lose their content f.i. when a fullscreen application is minimized.

Posted By: sivan

Re: TGA vs. PNG vs DDS for transparent textures - 07/20/12 08:08

in case of DXT5 compression dds alpha is not too bad, in contrary with DXT3. but yes, I use tga too when quality is needed. but use as much dds as you can, it has good effect on performance.
moreover, a better png engine support would be fine because those are usually much smaller in size than tga beside good quality.
Posted By: HeelX

Re: TGA vs. PNG vs DDS for transparent textures - 07/20/12 10:33

Originally Posted By: sivan
moreover, a better png engine support would be fine because those are usually much smaller in size than tga


On the hard disc - yes. But not in memory, because they are extracted to raw bitmaps and converted to the same DX format.
Posted By: sivan

Re: TGA vs. PNG vs DDS for transparent textures - 07/20/12 11:45

yes I thought of file size only
© 2024 lite-C Forums