DDS creation: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Geep (talk | contribs)
Add links to specific tool pages, textures, some restructuring
Geep (talk | contribs)
m Done, peter_spy & Geep
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''AUGUST 2020 - REWRITE IN PROGRESS''
''This page was entirely rewritten in August 2020 by peter_spy and Geep - A shortened version of the prior content here may be found at new page [[DDS Creation with ATI Compressonator]].
''All prior content here has been moved to new page [[DDS Creation with ATI Compressonator]].


==Introduction to DDS==
==Introduction to DDS==
Line 8: Line 7:
'''No need for conversion during load''': This is a target format in which textures are stored in your GPU memory. Other image types, like TGA, have to be converted during loading, and that makes the whole process longer.
'''No need for conversion during load''': This is a target format in which textures are stored in your GPU memory. Other image types, like TGA, have to be converted during loading, and that makes the whole process longer.


'''Better image quality with mipmapping''': Game engines use LOD systems to generate textures further away from the player, but that results in blurred image and moire patterns. Mipmaps are scaled-down versions of your texture. You can store them in the same file as your texture. This will improve image quality, the transition between LOD stages, and overall performance. More on mipmapping: https://en.wikipedia.org/wiki/Mipmap
'''Better image quality with mipmapping''': Game engines use LOD systems to generate textures further away from the player, but (without mipmaps available) that results in blurred image and moire patterns. Mipmaps are scaled-down versions of your texture, stored within the same file as the full-scale texture. Mipmaps will improve image quality, the transition between LOD stages, and overall performance. More on mipmapping: https://en.wikipedia.org/wiki/Mipmap


'''Very efficient compression''': Depending on the DDS compression format, a typical results is around 25% of the original uncompressed file. For example, a 2048 px RGB texture saved as uncompressed TGA will be around 12 MB. Save it as DDS, and you'll go below 3 MB. Other formats like PNG or Zip compression will give you around 9 MB.
'''Very efficient compression''': Depending on the DDS compression format, a typical results is around 25% of the original uncompressed file. For example, a 2048x2048 px RGB texture saved as uncompressed TGA will be around 12 MB. Save it as DDS, and you'll go below 3 MB. Other formats like PNG or Zip compression will give you around 9 MB.


==Textures in TDM==
==Textures in TDM==
Line 16: Line 15:
TDM can handle textures in either TGA or DDS formats. For guidance in preparing compliant texture files, applicable to both formats, see:
TDM can handle textures in either TGA or DDS formats. For guidance in preparing compliant texture files, applicable to both formats, see:
* [[How_to_add_Textures_to_The_Dark_Mod]]
* [[How_to_add_Textures_to_The_Dark_Mod]]
* [[Texture_Guidelines]]  
* [[Texture_Guidelines]]


==Folder Structure==


While all TGA files go to yourFmRootFolder/textures/darkmod/etc., DDS files should go to yourFmRootFolder/dds/textures/darkmod/etc. In other words, you need to copy-paste your folder structure into the dds directory.
'''Folder structure in your FM'''


==General Workflow Tips==
While all TGA files go to:


– Convert to DDS when you have finished textures that make up your material. There are at least two reasons for that:
    yourFmRootFolder/textures/''[optional subfolder(s)]''


'''DDS format isn't suited for fast iteration''': You have to restart the game and reload the map to see the any changes. With TGA files, you just need to use a refresh command to see your changes in an instant.
DDS files should go to:


'''DDS compression is lossy''': While the compression ratio is pretty great, it slightly reduces image quality. You shouldn't work on DDS textures directly, as you'll decrease image quality with each save. Keep your source files and work on them instead, then export TGAs to DDS when you're happy with the final result.
    yourFmRootFolder/'''dds'''/textures/''[optional subfolder(s)]''


– You can safely convert most textures to DDS except for normal maps. The latter are not images in traditional sense, they're more like vector maps. Any lossy compression will always introduce some artifacts and otherwise damage that data. To be on the safe side, keep normal maps as TGAs.
In other words, you need to copy-paste your folder structure into the dds directory. (At one time, the DDS hierarchy could be no more than 5 deep; this is no longer an issue.)


TDM gives DDS files higher priority than TGAs. If you have both TGA and DDS textures for your material, the engine will only load the latter. If you want to get back to work on your material, re-export its textures as TGAs and delete corresponding DDS files.
'''Priority''': TDM gives DDS files higher priority than TGAs. If you have both for a given material, the engine will only load the DDS.


==DDS Compression Formats==
'''Leave Normal Maps as TGA''': You can safely convert diffuse and specular textures to DDS. But normal (bump) maps are not images in the traditional sense; they're more like vector maps. Any lossy compression will always introduce some artifacts and otherwise damage that data. To be on the safe side, keep normal maps as TGAs.


DDS files can be compressed in different ways, depending on source image requirements. As a general rule, RGB images use DXT1 compression, while textures with alpha channel need DXT5. More info on compression formats: http://wiki.polycount.com/wiki/DXT
==DDS Creation, In General ==


==Mipmaping Tips==
'''Compression Formats''': DDS files can be compressed in different ways, depending on source image requirements. As a general rule, use -
* DXT1 compression with RGB images
* DXT5 for textures with alpha channel transparency
More info on compression formats: http://wiki.polycount.com/wiki/DXT


Mipmap generation is mandatory in TDM. Otherwise DDS textures won't show in game and you'll get console errors.
'''Mipmaping''': Mipmap generation is mandatory in TDM. Otherwise DDS textures won't show in game and you'll get console errors.


– Mipmapping is affected by in-game Anisotropic Filtering. Set it to x16 to ensure maximum image quality while testing your materials.
TIP: You can improve texture quality - at no additional performance cost - by using the best mipmaps scaling filter available in the DDS file export settings. Usually they're ordered from faster/low-quality to slower/high-quality.
 
You can improve texture quality at no additional performance cost by using the best scaling filter in DDS file export settings. Usually they're ordered from faster/low-quality to slower/high-quality.


==DDS Creation with Specific Tools==
==DDS Creation with Specific Tools==
* [[DDS Creation with GIMP]]
* [[DDS Creation with GIMP]]
* [[DDS Creation with ATI Compressonator]]
* [[DDS Creation with ATI Compressonator]]
==General Workflow Tips==
* Convert to DDS only after you have finalized textures that make up your material. There are at least two reasons for that:
: '''DDS format isn't suited for fast iteration''': You have to restart the game and reload the map to see the any changes. With TGA files, you just need to use a refresh command to see your changes in an instant.
: '''DDS compression is lossy''': While the compression ratio is pretty great, it slightly reduces image quality. You shouldn't work on DDS textures directly, as you'll decrease image quality with each save. Keep your source files and work on them instead, then export TGAs to DDS when you're happy with the final result.
* Planning to revise and test your material's textures? Besides re-exporting the updated textures as TGA, be sure to delete its old DDS textures, that would have priority.
==Testing Your DDS Texture==
Mipmapping is affected by in-game Anisotropic Filtering. Set it to x16 to ensure maximum image quality while testing your materials.
==See Also==
* [http://wiki.polycount.com/wiki/DXT DDS compression formats]
* [https://en.wikipedia.org/wiki/Mipmap Mipmaps]
    
    
[[Category:Tutorial]]
[[Category:Tutorial]]
[[Category:Textures]]
[[Category:Textures]]

Latest revision as of 15:51, 1 September 2020

This page was entirely rewritten in August 2020 by peter_spy and Geep - A shortened version of the prior content here may be found at new page DDS Creation with ATI Compressonator.

Introduction to DDS

DDS (Direct Draw Surface) is an image format often used in games due to its significant advantages over other file types:

No need for conversion during load: This is a target format in which textures are stored in your GPU memory. Other image types, like TGA, have to be converted during loading, and that makes the whole process longer.

Better image quality with mipmapping: Game engines use LOD systems to generate textures further away from the player, but (without mipmaps available) that results in blurred image and moire patterns. Mipmaps are scaled-down versions of your texture, stored within the same file as the full-scale texture. Mipmaps will improve image quality, the transition between LOD stages, and overall performance. More on mipmapping: https://en.wikipedia.org/wiki/Mipmap

Very efficient compression: Depending on the DDS compression format, a typical results is around 25% of the original uncompressed file. For example, a 2048x2048 px RGB texture saved as uncompressed TGA will be around 12 MB. Save it as DDS, and you'll go below 3 MB. Other formats like PNG or Zip compression will give you around 9 MB.

Textures in TDM

TDM can handle textures in either TGA or DDS formats. For guidance in preparing compliant texture files, applicable to both formats, see:


Folder structure in your FM

While all TGA files go to:

    yourFmRootFolder/textures/[optional subfolder(s)]

DDS files should go to:

    yourFmRootFolder/dds/textures/[optional subfolder(s)]

In other words, you need to copy-paste your folder structure into the dds directory. (At one time, the DDS hierarchy could be no more than 5 deep; this is no longer an issue.)

Priority: TDM gives DDS files higher priority than TGAs. If you have both for a given material, the engine will only load the DDS.

Leave Normal Maps as TGA: You can safely convert diffuse and specular textures to DDS. But normal (bump) maps are not images in the traditional sense; they're more like vector maps. Any lossy compression will always introduce some artifacts and otherwise damage that data. To be on the safe side, keep normal maps as TGAs.

DDS Creation, In General

Compression Formats: DDS files can be compressed in different ways, depending on source image requirements. As a general rule, use -

  • DXT1 compression with RGB images
  • DXT5 for textures with alpha channel transparency

More info on compression formats: http://wiki.polycount.com/wiki/DXT

Mipmaping: Mipmap generation is mandatory in TDM. Otherwise DDS textures won't show in game and you'll get console errors.

TIP: You can improve texture quality - at no additional performance cost - by using the best mipmaps scaling filter available in the DDS file export settings. Usually they're ordered from faster/low-quality to slower/high-quality.

DDS Creation with Specific Tools

General Workflow Tips

  • Convert to DDS only after you have finalized textures that make up your material. There are at least two reasons for that:
DDS format isn't suited for fast iteration: You have to restart the game and reload the map to see the any changes. With TGA files, you just need to use a refresh command to see your changes in an instant.
DDS compression is lossy: While the compression ratio is pretty great, it slightly reduces image quality. You shouldn't work on DDS textures directly, as you'll decrease image quality with each save. Keep your source files and work on them instead, then export TGAs to DDS when you're happy with the final result.
  • Planning to revise and test your material's textures? Besides re-exporting the updated textures as TGA, be sure to delete its old DDS textures, that would have priority.

Testing Your DDS Texture

Mipmapping is affected by in-game Anisotropic Filtering. Set it to x16 to ensure maximum image quality while testing your materials.

See Also