Sign in to follow this  

which texture format should I use?

This topic is 4379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

Just a word on behalf of packed texture formats. The Nvidia photoshop plugin is able to preview different formats at the save time and gives the artist a change to evaluate the quality loss of DXT-compression. Usually the quality loss is unnoticeable, especially when using high resolution textures.

One has to understand the technique behind DXT compression since it is quite different from JPG for example. With DXT, the quality degrades only when there is lots of different colors in a small area. For example, a grass texture which contains mostly green hues doesn't loose practically any quality.

Non-packed texture formats are useful mostly on pixel exact graphics such as GUI elements, but even there DXT might be useful. If it looks right, then it is right. Right ?

Cheers

Share this post


Link to post
Share on other sites
Quote:
Original post by darkelf2k5
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.


DXT is quite slow to compress on load, I would recommend against it. You will definitly notice the load time. dds is basically a binary dump of the textures, so its very fast to load because no conversion needs to happen. Even simple conversions can take a while on 1kx1k texture.

Ussually, I use an image cache for my apps. I'll do something like:

if(!(S_OK != LoadD3DXTextureFromFile(..., "mytexture.dds"))
{
D3DXTextureFromFile("mytexture.whataver");
D3DXLoadTextureFromTexture(...); //turn it into a DXT, or whatever I need
D3DXSaveTexture("mytexture.dds");
}


That way you keep you original textures in a conveinent format, but get really fast load times (highly underrated these days). The only catch is you have to delete your image cache if you change your images

Share this post


Link to post
Share on other sites

This topic is 4379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this