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

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

Tutorials & Resources For Modellers & Skinners

Moderators: MR.D, Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh » 08 Mar 2010, 03:13

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 3 times
0 x

Master-Athmos
Posts: 862
Joined: 27 Jun 2009, 01:32

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

Post by Master-Athmos » 09 Mar 2010, 16:24

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?
0 x

User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

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

Post by SanadaUjiosan » 27 Mar 2010, 22:46

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?"
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh » 30 Mar 2010, 20:20

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.
0 x

User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

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

Post by rattle » 04 Apr 2010, 14:03

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
0 x

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

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

Post by lurker » 04 Apr 2010, 15:52

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.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh » 04 Apr 2010, 21:59

DDS can be lossless
Yeah, and that's what I used to use, but it kinda defeats the purpose.
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.
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.
0 x

User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

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

Post by enetheru » 16 Jul 2010, 08:13

Was looking into this. nvidia's texture tools are MIT licenced and compile fine on linux
http://developer.nvidia.com/object/texture_tools.html
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6109
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi » 16 Jul 2010, 13:09

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.
0 x

MaDDoX
Posts: 53
Joined: 08 Jan 2006, 17:45

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

Post by MaDDoX » 20 Sep 2017, 06:11

nVidia's old plugin is only compatible with a 32-bit Photoshop. If you use a newer Photoshop, especially 64-bits, make sure you download this amazing open source plugin here: http://fnordware.blogspot.com.br/2014/0 ... s-and.html

I tested it on CC.2017 and generated .dds files (with mipmaps + DXT5) worked flawlessly with Spring + ASSIMP. I've added a walkthrough to the Wiki, you can find it here:
https://springrts.com/wiki/3DModels:AssimpWorkflow
1 x

raaar
Metal Factions Developer
Posts: 817
Joined: 20 Feb 2010, 12:17

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

Post by raaar » 20 Sep 2017, 06:37

This thread was created in 2010. I wonder how important this is today.

Do people making maps/games use this format extensively?

I generally use bmp and tga for textures. I used dds on ground decals.

Would converting all unit textures from bmp/tga to dds have a big impact on performance?
0 x

MaDDoX
Posts: 53
Joined: 08 Jan 2006, 17:45

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

Post by MaDDoX » 20 Sep 2017, 15:30

Good question. From my experience with other engines I would say yes, it has a performance boost in the loading time, since there'd be no need to generate mipmaps of the textures, just send it directly to the GPU. I have no idea what ATI cards do with that format though, since it's an open source format it probably converts it on the GPU - but don't quote me on that.
Last edited by MaDDoX on 20 Sep 2017, 20:18, edited 1 time in total.
0 x

User avatar
Silentwings
Moderator
Posts: 3593
Joined: 25 Oct 2008, 00:23

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

Post by Silentwings » 20 Sep 2017, 16:42

We used dds as our default format in BAR because of better loading time. It made enough difference to be worth it.
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6109
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi » 20 Sep 2017, 19:07

You can also have finer control over how textures are displayed at different distances as dds contains all the mipmaps and you can set various filters when creating a dds image to e.g. sharpen the mips.
1 x

Post Reply

Return to “Modelling & Texturing Tutorials & Resources”