DDS Creation with GIMP
August 2020, by peter_spy and Geep
Introduction
Please review DDS creation for general, tool-independent guidance on DDS creation for TDM.
GIMP (Gnu Image Manipulation Program) is a popular, no-cost image editor. Originally, a separate plugin was required to open and save DDS images, but since version 2.10.10 in April, 2019, this functionality is available out of the box. You can find the most recent version here.
Readying Your Image
Open your image file (typically TGA) in GIMP. The "Layers" pane on the right hand side should then display just one layer. Its name will be
- in bold font, if the image is opaque, or
- in regular font, if it uses an alpha channel.
DDS does not support layers. If you choose to do any image editing that adds additional layers, when done editing, you must
- merge the layers, if preserving the alpha channel
- flatten the image otherwise.
Exporting Your Image as a DDS File
From the top menu bar, choose "File > Export As..." or press Ctrl + Shift + E. In the "Export Image" window, use "Browse" to navigate to the proper folder in your DDS directory structure (discussed in DDS creation). In the "Name" field at the top, change the file extension from ".tga" to ".dds". Click "Export" or hit Enter.
In the resulting "DDS Exporter" dialog box, choose from available options:
Compression: Use DXT1 for opaque images and DXT5 for textures with alpha channel.
Mipmaps: Always pick "Generate Mipmaps", to avoid in-game errors.
In the "Mipmap Options" Section:
- Filter: Scaling filter for mipmaps. The dropdown list is ordered from faster/low-quality to slower/high-quality algorithms. If you're not sure which one to choose, pick the last one. It's recommended to use the best scaling filter available, as it improves the quality of textures rendered further away from the player, without any additional performance cost.
- Wrap mode: This specifies how beyond-the-boundary pixels are filled in during mipmap level generation. Recommendations:
- "Default" (namely "Wrap") is the best choice with tileable textures, since it repeats the texture in a 2D tiled manner.
- "Clamp" just clones the border pixels. It can be useful with textures that won't be tiled, e.g., models unwrapped in 0-1 texture space.
- "Mirror" flips the texture, which is useful in games that can do automatic flipping during tiling (not TDM). Also, an alternative to "Clamp" for untiled textures.
- A reference below links to illustrations of these modes.
- All other options are fine as is.
See Also
- For a user-written exploration of GIMP DDS plug-in options (circa 2018 and not specific to TDM), see this GIMP-Forum post and its download.
- For helpful pictorial images of the Wrap, Clamp, and Mirror options, contained in a lengthy technical tutorial, see "3D Game Engine Programming" - DirectX 12 - Part 4, Textures.
Deeper Dives into Filter Choices When Mipmapping
- An early, clear text explanation of basic algorithms
- A downloadable slide show
- For a tutorial with comparison of Box, Lanczos, and Kaiser filters, and thoughtful discussion of Mitchell filter and filter artifacts generally: Mipmapping Part 1 and Part 2
- Source code for GIMP DDS may be of interest to graphical algorithm mavens.