DDS creation: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(Add links to specific tool pages, textures, some restructuring)
(Re-organize)
Line 8: Line 8:
'''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==
==Deploying 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:
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==
'''Folder structure in your FM''': While all TGA files go to


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.
    yourFmRootFolder/textures/''[optional subfolder(s)]''


==General Workflow Tips==
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. [Is the stricture about 5-deep dds folder structure still true?]
 
'''Priority''': TDM gives DDS files higher priority than TGAs. If you deploy 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.


– Convert to DDS when you have finished textures that make up your material. There are at least two reasons for that:
==DDS Creation, In General ==


'''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.
'''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


'''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.
'''Mipmaping''': Mipmap generation is mandatory in TDM. Otherwise DDS textures won't show in game and you'll get console errors.


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


– 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.
==DDS Creation with Specific Tools==
* [[DDS Creation with GIMP]]
* [[DDS Creation with ATI Compressonator]]


==DDS Compression Formats==
==General Workflow Tips==


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
* Convert to DDS only after you have finalized textures that make up your material. There are at least two reasons for that:


==Mipmaping Tips==
** '''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.


– Mipmap generation is mandatory in TDM. Otherwise DDS textures won't show in game and you'll get console errors.
** '''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.


– Mipmapping is affected by in-game Anisotropic Filtering. Set it to x16 to ensure maximum image quality while testing your materials.
* 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.


– 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.
==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.


==DDS Creation with Specific Tools==
==See Also==
* [[DDS Creation with GIMP]]
* [http://wiki.polycount.com/wiki/DXT DDS compression formats]
* [[DDS Creation with ATI Compressonator]]
* [https://en.wikipedia.org/wiki/Mipmap Mipmaps]
    
    
[[Category:Tutorial]]
[[Category:Tutorial]]
[[Category:Textures]]
[[Category:Textures]]

Revision as of 17:07, 18 August 2020

AUGUST 2020 - REWRITE IN PROGRESS All prior content here has been moved to 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.

Deploying 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. [Is the stricture about 5-deep dds folder structure still true?]

Priority: TDM gives DDS files higher priority than TGAs. If you deploy 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