View topic - How-To: All you ever wanted to know about DDS



All times are UTC + 1 hour


Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 08 Mar 2010, 03:13 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
This article will show you how to convert textures for models into the DDS format, simply and easily, using free software.

What's DDS, and why should you use it?

DDS stands for "Direct Draw Surface". It is a texture format developed specifically for the needs of realtime 3D programs, such as games.

All commercial games use DDS; it is the standard format for realtime 3D applications because of the performance advantages it gives.

If you are here because you are interested in learning more about how to make content for realtime settings, either for games you'd like to program someday or as an artist, learning about DDS is mandatory.

2. DDS is handled by video cards, through their drivers, and has some major performance advantages, depending on which version of DDS is used:

A. DDS DXT1, while only allowing for 1-bit alpha (i.e., black or white pixels only), takes up 1/8th of the texture RAM on a video card, vs. formats like TGA and PNG.

B. DDS DXT3 and DXT5, which allow for compressed, 8-bit alpha, take up 1/4th of the texture RAM on a video card, vs. formats like TGA and PNG.

C. All DXT formats are pre-optimized in a number of ways, and generally operate a little faster than other formats.


3. DDS allows you to have a lot of control over how each mip level looks. TGA, PNG, etc. do not. Therefore, your textures can and will look different on different hardware, driver settings, etc., if you use other formats.

4. DDS looks "right" in UpSpring and in Spring itself; it was the graphics format UpSpring was designed to handle.



How do I convert my textures to DDS?

There are a large number of applications / plugins for doing this- this list is maybe a quarter of the programs available, but I've tested all of these (aside from the PSP plugin). All of the ones linked here are free, and the GIMP plugin is Open Source.

There is a plugin for GIMP. Source is provided, for users wanting to use this natively under Linux or other operating systems. This is almost as powerful as the Photoshop plugin, and is a powerful tool.

nVidia's Photoshop plugin. This is probably the best choice, if you have Photoshop and are a graphics guru. It is a very powerful and flexible tool.

This is an older version of the Photoshop plugin that is compatible with PaintShop Pro 9. I have never used this, and can't vouch for it, but there's a link.

ATi's Compressionator. This is a free tool available for download from AMD. It is a very useful tool both for compression and for previewing the mipmap levels post-compression.

DDS Converter 2.1. This is a free tool for compressing DDS files. It's a little unintuitive to set up, but it's one of the easiest tools to use, once you've configured it.


OK, I have this software or plugin, but it looks really complicated? What settings should I use?

There really aren't any "best" settings that work perfectly for all applications. DDS is powerful and flexible; that means that it can do a lot of things, but it also means it's pretty complicated.

That said, giving you, the newbie, that answer doesn't actually help you any. So, here's a practical workflow, using the Compressionator, which is probably the easiest of the available tools to use:

1. Open The Compressionator.

2. Click on File-->Open to select the image you want to compress.

3. Click on Compress-->DirectX Texture Compression to select the DDS compression settings.

4. On the left, there are radio buttons under Texture Format. Click on the radio button marked DXT5 (6/8 interpolated alpha), like this:

Image

5. Click Compress. This may take a second or two, for a large texture.

6. Click on File-->Save Compressed to save the compressed image to your unittextures folder.

7. In UpSpring, open your model, click on the Mapping tab, click the appropriate browse button, and select the new texture. Don't forget to save your model after adding the texture. If the texture is "wrong", because you flipped it previously, you will need to flip it vertically in whatever paint program you used, save it, and re-convert it (or, if you're using the GIMP / Photoshop plugins, just open it with them, flip and re-save them).

That's it. The Compressionator is very easy to use, and produces a good result most of the time.


Attachments:
illustration.jpg [37.61 KiB]
Downloaded 2 times
Top
 Offline Profile  
 
PostPosted: 09 Mar 2010, 16:24 

Joined: 27 Jun 2009, 00:32
Location: Germany
Looks pretty complete - good job. My only "complaints" would be that you could add a recommendation to only include mipmaps when really needed. Like when you're doing your buildpics as DDS you're fine with DXT1 and you need no mipmaps here...

Oh and btw - it's "Compressonator" and has no "i" in it... :mrgreen:

EDIT:
Do you happen to know a downloadlink for the Compressonator you don't have to register for?


Top
 Offline Profile  
 
PostPosted: 27 Mar 2010, 22:46 
Conflict Terra Developer
User avatar

Joined: 21 Jan 2010, 06:21
Location: Tucson
So I just tried this for the first time, used the nVidia Photoshop Plugin. I saved it as a:
"DXT5 ARGB 8 bpp | interpolated alpha"

Since that most closely matched your example. Reading over your post, I think I understand, but I'd just like to clarify, because my texture came out in Spring with more visible compression than it did using Targa.

This DDS is mostly about performance, as opposed to the texture straight-up looking "good", right? Or, as you said, it's just very flexible and I'd have to tweak these settings (that I know nothing about) to make it look "good?"


Top
 Offline Profile  
 
PostPosted: 30 Mar 2010, 19:20 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
1. You will see some compression artifacts. But it's usually invisible at anything but screenshot distance, if you have adjusted your settings correctly.

2. The performance advantages outweigh the slight difference in quality most of the time. There are exceptions- if you're using the full color range, or pretty close, then you might see some serious problems with quality at that point. However, very few RTS units use huge color ranges in their palette, and it's very easy to optimize your palette use around a lower range.

3. I didn't mention #mips because I don't use DDS for things like buildpics, because there's no advantage for anything that doesn't have multiple mipmaps, imo, and you might as well use something lossless.

4. No, I don't know where to get The Compressonator without registering, but I guess I don't really have any issues with that- I really don't mind ATi knowing that there are people out there interested in their tools, and registering takes very little time. I guess I could upload a copy of it, but I'll have to read the EULA and see if redistribution of the installer from third-party sources is permitted.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2010, 13:03 
Damned Developer
User avatar

Joined: 01 Jun 2006, 12:15
Location: Banned user for reason “Do not post pictures of people fucking cars”
Quote:
3. I didn't mention #mips because I don't use DDS for things like buildpics, because there's no advantage for anything that doesn't have multiple mipmaps, imo, and you might as well use something lossless.
DDS can be lossless


Top
 Offline Profile  
 
PostPosted: 04 Apr 2010, 14:52 
Redacted
User avatar

Joined: 08 Jan 2007, 06:13
Location: Don't be silly. If there's no machine heaven, where do all the toasters go?
Why do I care about making the mipmaps be exactly the same if I'm just using the automatic ones?


It needs to be said that while many textures will compress fine, certain types of small colored details will be ruined. DXT only lets you have two colors and a mix per 4x4 block.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2010, 20:59 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
Quote:
DDS can be lossless
Yeah, and that's what I used to use, but it kinda defeats the purpose.

Quote:
Why do I care about making the mipmaps be exactly the same if I'm just using the automatic ones?
So that what you see on your hardware is exactly what everybody else sees. As an artist, I want to know that, aside from AA / aniso, the results are the same everywhere.

The automatic driver-created mips aren't necessarily all that great, and differ between hardware and drivers. What may look really good on a high-end card with 8X multipass AA and 4X aniso may look pretty awful on a midrange card with both set to Spring's defaults.

Quote:
It needs to be said that while many textures will compress fine, certain types of small colored details will be ruined. DXT only lets you have two colors and a mix per 4x4 block.
This is true, but in most cases, it works out. The only things where I've seen problems that made it unsuitable are where we're expecting a rainbow of subtle color values. Most things are in fairly concrete blocks of color- here's an armor panel, there's a gun, there's a white shirt, etc., and the compression errors are hard to actually see, at anything but maximum zoom. And the sharpening steps in the lower mips, if done right, results in a considerable difference in quality vs. the default filters.

I guess in the end, the argument about Quality is pretty nebulous, but all of the AAA games use DDS, and if it's good enough for Fallout 3, it's good enough for Spring.


Top
 Offline Profile  
 
PostPosted: 16 Jul 2010, 07:13 
User avatar

Joined: 11 Jun 2010, 06:32
Location: Adelaide, Australia
Was looking into this. nvidia's texture tools are MIT licenced and compile fine on linux
http://developer.nvidia.com/object/texture_tools.html


Top
 Offline Profile  
 
PostPosted: 16 Jul 2010, 12:09 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
NVTT are CUDA enabled which is nice, but nvcompress lacks the options of the previous generation NVDXT - unless you want to write your own alternative using the library.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.