which texture format should I use?

Started by
11 comments, last by EvilDecl81 18 years, 3 months ago
HI Can anyone suggest me a texture format which is faster to load and map on objects? I think DDS is faster than others. I myself use .tif files. should i convert them to .DDS file format or i'm ok with .tif ones??? THX in advance. ----------------------------------------------- death is not the beginning but only a transition.
Advertisement
If using Direct3D then .dds is the obvious choice unless you want to make your own custom format. TIF isn't bad though, someone else can say why .dds is/isn't better than .tif...
DDS is not a texture format. It's a file extension.
The more compressed the image file, the slower to load it imho. Thus DXT1 is slower than DXT5. Not that you can tell the difference unless you use huge textures.
Once loaded, its just data in memory, mapping speed is unrelated to extension.
Every time you implement a singleton, God kills a kitten. Please, think of the kittens!
Quote:Original post by darkelf2k5
DDS is not a texture format. It's a file extension.[...]
Once loaded, its just data in memory, mapping speed is unrelated to extension.

DDS is not just an extension. An extension, in windows, is associated with 'file type'. DDS is an image file format, and the way image file formats dictate how to store the image data does influence load-time.

From what I understand, loading a DXT1 texture that's stored in a .dds in DXT1 format is extremely fast, as there's no conversion necessary. Contrast this to loading a .tif file into a DXT1 format, which will be slower because of the compression step necessary. So yeah, you should convert them to DXT1 format (if you don't need alpha) and store it in a .dds file.

As far as runtime performance goes, DXT1 textures are slower than uncompressed formats because each texture lookup involves a decompression step. All major cards since DX7 support hardware texture compression/decompression, so the performance hit is pretty negligible escpecially considering the 4:1 compression ratio.
For each graphic resource in your game you might decide to save the file on disk as a JPEG (smallest with high quality, but some loss of information), TGA/TIF (lossless with alpha but large file size), PNG (excellent format with alpha and lossless compression), DDS (fast, small, but looks bad IMO), or others. (These are the formats I have found most useful.)

Be careful to make the distinction, as others have pointed out, between your graphic resource on disk and the version loaded into memory. The answer to your question (which texture format should I use?) is probably either DXT? or 32-bit RGBA. Every format that's NOT DDS will be decompressed into full memory at load time, so disk space/load time become more important issues. DDS might be a good choice for obscure textures or things that don't need to be particularly clear, but the loss of quality is definitely obvious and I highly don't recommend it for anything that needs to look good, like your GUI elements.

DDS stands for "Direct Draw Surface". Loading DDS is fast (on a device which supports to DDS format contained in the file). There are several Direct Draw Surface formats such as A8R8G8B8, A1R5G5B5 or packed DXT1-5 etc and a DDS file can contain any of these. Also DDS file can contain mipmaps, which isn't the case with TGAs or TIFFs or JPGs, thus saving loading time.

On a relative modern GPU (such as GF3) using packed texture formats (DXT1-5) is very beneficial. Not only you get higher resolution textures with the same amount of texture memory, but also some cards may actually render slightly faster with packed textures (less memory bandwidth is required for transferring texels).

NVidia has a DDS reader/writer plugin for Photoshop and DX contains routines for loading DDS file from disk or memory. Of course, DXT is a lossy format, but with the photoshop plugin you can see differences between different formats. At least, DDS file can contain exactly the same data as TGA or TIFF (with mipmaps).

Best regards
thanks for the replies.
Could someone explain to me what are packed textures. and if DDS files are uncompressed then why they look bad???
So if size is not important then DDS and TIFF are good choices. am i right???
and what about PNG??? are they better than TIF???
THX again
DDS files are not restricted to a single data format. Actually, a DDS file contains the data exactly as it would be placed on the GPU. So, when a DDS file is loaded, the data is directly copied to the GPU with no extra work done.

As for quality, DDS files shouldn't change the quality of the texture. However, they do support many different formats, some of which may lower quality.

If you're using DX, and you size isn't a problem, I'd recommend using .DDS files. Just make sure to use an uncompressed color format (A8R8G8B8, for example).
Sirob Yes.» - status: Work-O-Rama.
any other ideas???

This topic is closed to new replies.

Advertisement