DDS Creation with ATI Compressonator: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(Creation, with content moved from 'DDS creation')
 
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''Note - Prior to August, 2020, this content lived at [[DDS creation]]. Go there for a newly-written tool-independent overview of DDS creation. Further revision of the material below is planned.''
''Note - Before August, 2020, a longer predecessor of this content lived at [[DDS creation]]. Go there for a newly-written tool-independent overview of DDS creation.''


This quick guide will describe the steps you'll have to follow in order to create DDS files suitable for use in your Dark Mod maps and how to convert from DDS to other image formats using "[http://darkmod.taaaki.za.net/tools/ati_compressonator_v1.21.zip The Compressonator]". DDS files are a lot smaller than the uncompressed TGAs, often around 15% of the size. The greatest benefit of this is seen in performance and the benefit of using higher res textures.  
== Introduction ==
ATI's "The Compressonator" was important during early TDM development. Now, the version of the program discussed here (indeed, any version under the ATI brand) is old and should not be your first choice, but may still have its uses. See also the "Successors" section at the end.


It is strongly suggested that while you are creating and adjusting your texture that you should use TGA until you are ready to release it and then compressing the relevant images to DDS for release.
Find [http://darkmod.taaaki.za.net/tools/ati_compressonator_v1.21.zip "The Compressonator" version 1.21.1044 here]. Install/unzip it to a folder and create a shortcut if you like. (At one time, the foregoing exact version was required, because it alone could compress DXT5 RXGB normalmaps. Compression of normalmaps should no longer be done.)


== Guidelines for DDS Textures ==
After running the installer, you will likely find when you try to run "The Compressonator", that the installation was incomplete. To complete it, inspect the distribution .zip for a folder that contains MSVCP71.DLL. With Admin privileges, copy MSVCP71.DLL to where the program lives, typically c:/Program Files (x86)/ATI Technologies Inc/The Compressonator.


Due to these reasons it is '''strongly recommended''' that you compress both '''diffuse''' and '''specular''' textures. Normalmaps should however not be compressed, please use TGA!
Please review [[DDS creation]] for general information about
* working with TGA and DDS, and where files should be placed in your FM
* suggested DDS creation settings


*'''Diffusemap :'''
== Compressing Diffuse and Specular Maps ==
:Does the texture have '''transparency'''?(i.e leaves, spiderwebs etc)
:*If '''NO: DXT1'''
:*If '''YES: DXT5''' and read the following note:
Note : Please be aware that at the moment TDM/Doom 3 only supports hard edges for transparency, as such you wont get the gradual blending from transparency, however in the future it is likely that we will be able to have this smooth blending, so saving your transparency in with DXT5 and then using the alphaTest keyword in your material will allow you to control where the hard edge is located easily. If your texture is meant to only ever have a hard edge you may also experiment with using the explicit alpha in DXT1 as this compresses much better.
*'''Specularmap :'''
:*'''DXT1''' - should be more than adequate as specular does not require alpha information.
*'''Normalmap :'''
:*'''NONE''' - Use TGA!
 
 
DXT3 can be used, however it has very little benefit and is not worth using unless you have a specific reason.
 
 
 
==Converting Image To DDS==
You'll need [http://darkmod.taaaki.za.net/tools/ati_compressonator_v1.21.zip ATI's "The Compressonator" application version 1.21.1044] with this exact version - other versions might work for diffuses and speculars, but for compressing DXT5 RXGB normalmaps this is the only version that works. Install/unzip it to a folder and create a shortcut if you like.
 
=== Compress Diffuse/Specular Maps ===
* Open your source (TGA) file
* Open your source (TGA) file
* Create Mip Maps using the '''Box-Filter''' with the lowest mip map size of '''1x1'''.
* In the Mip Maps toolbar's pulldown, select '''Box-Filter'''. Press "Generate", and then a Lowest Mip-Level size of '''1x1'''.
[[Image:01_mips.jpg|frameless]]
[[Image:01_mips.jpg|frameless]]


* Click the Compress button next to "DirectX Texture Compression"
* In the Compression toolbar's pulldown, select '''DirectX Texture Compression'''. Click the "Compress" button.
* Select the correct compression type by reading the section above, [[DDS creation#Guidelines for DDS Textures|Guidelines for DDS Textures]]
* Choose the correct compression type:
* Make sure that the channel weighting values are as follows :
**'''Diffusemap:''' Does the texture have '''transparency'''(i.e., leaves, spiderwebs, etc)? '''NO: DXT1'''. '''YES: DXT5'''
:'''red=0.3086'''
**'''Specularmap: DXT1''' - specular does not require alpha information.
:'''green=0.6094'''
**'''Normalmap: NONE''' - Use TGA!
:'''blue=0.082'''
* Don't change the default channel weighting values of :
* Click Compress
:red=0.3086
:green=0.6094
:blue=0.082
 
* Click "Compress"
[[Image:02_compression.jpg|frameless]]
[[Image:02_compression.jpg|frameless]]


* Save your DDS to the '''dds/''' tree, e.g. dds/textures/darkmod/stone/blah.dds.
* Save your DDS to the '''/dds/''' tree
 
 
'''Note about file locations:'''
If the TGA version of your image (e.g a working diffuse) was located at :
:/doom3/mymission/textures/brick/mybrick.tga
You will save the dds to :
:/doom3/mymission/dds/textures/brick/mybrick.dds
However in the material file you will still refer to it as :
:textures/brick/mybrick
Make sure to remove your TGA to test the finished DDS, if you have followed this it will work flawlessly.
 


=== Change the File Extension to lowercase ===
=== Change the File Extension to Lowercase ===
The Compressonator automatically names the file *.DDS, but all files should be lowercase (including TGAs). Be sure to rename the files to a lowercase .dds extension before uploading them.
The Compressonator automatically names the file *.DDS, but all files should be lowercase (including TGAs). Be sure to rename the files to a lowercase .dds extension before game testing:


Option A: Use Windows Explorer. You need to change your Explorer settings to display the file extension:
Option A: Use Windows Explorer. You need to change your Explorer settings to display the file extension:
Line 67: Line 45:
:ren *.DDS *.dds
:ren *.DDS *.dds


== Working with Transparency/Alpha==
== About Transparency ==
Quite often when working with alpha and converting from TGA to DDS you will have trouble getting the alpha to work correctly. There are a number of causes for this however the easiest way to deal with it is to rather save your texture out as a TIFF and then open it in The Compressonator, if you are saving from Photoshop/GIMP disable layers in the save options but make sure its set to preserve transparency. When opening it in The Compressinator remember to right click in the image and view RGBA/Alpha to check that it is correct before generating mipmaps or compressing.
At this time TDM only supports hard edges for transparency, so you won't get a gradual blending. However, saving the 8-bit alpha channel - and using DXT5 compression - "future-proofs" your material for a day when TDM could support this smooth blending. In the meantime, hard edge clipping occurs by default at 50%; use the the "alphaTest" keyword in your material to easily control this.
 


When converting from TGA with Alpha to DDS, the alpha doesn't always work correctly. Causes for this vary, but:
* One easy workaround is to save your texture out as a TIFF and then open that in The Compressonator.
* If you are saving from Photoshop/GIMP, disable Layers in the save options, but make sure it's set to preserve transparency.
* When opening it in The Compressonator, right click in the image and view RGBA/Alpha to check that it is correct, before generating mipmaps or compressing.


== Batch Processing ==
== Batch Processing ==
Choose '''File > Batch Compress''' or hit F4 to open the batch compression dialog. Choose the same compression settings as described above for your diffuse and normal maps. Don't mix diffuse/speculars with normals as they require different compression settings.
Choose '''File > Batch Compress''' or hit F4 to open the batch compression dialog. Choose the same compression settings described above, while taking care to separate file groups that use different compression settings.


[[Image:dds_batch_screenshot.jpg|frameless]]
[[Image:dds_batch_screenshot.jpg|frameless]]


== Command Line Parameters ==
== Command Line Parameters ==
ATI's compressonator provides some command line parameters to compress the textures:
ATI's compressonator provides some command line parameters to compress the textures:
thecompressonator -convert "normal.tga" "normal.dds" RXGB +red 0.0 +green 0.5 +blue 0.5 -mipmaps
  thecompressonator -convert "specular.tga" "specular.dds" DXT1 -mipmaps  
  thecompressonator -convert "specular.tga" "specular.dds" DXT1 -mipmaps  
  thecompressonator -convert "diffuse.tga" "diffuse.dds" DXT1 -mipmaps  
  thecompressonator -convert "diffuse.tga" "diffuse.dds" DXT1 -mipmaps  
  thecompressonator -convert "diffuse_with_alpha.tga" "diffuse.dds" DXT5 -mipmaps
  thecompressonator -convert "diffuse_with_alpha.tga" "diffuse.dds" DXT5 -mipmaps


 
==Converting From DDS to Common Image File Formats==
 
==Converting FROM DDS to common image file formats==


This is trivial but slightly confusing on The Compressonator:
This is trivial but slightly confusing on The Compressonator:


* File Menu > Save Original
* File Menu > Save Original
* At the bottom of the dialog below the file name input select ''save as type''. It may show DDS by default so don't be put off.
* At the bottom of the dialog, below the file name input, select ''save as type''. It may show DDS by default; don't be put off.
* Select file format from BMP, PNG, or TGA (use TGA generally for Dark Mod.)
* Select file format from BMP, PNG, or TGA (use TGA generally for Dark Mod.)
* Make sure the filename you want is shown in the input box and click ''save''.
* Make sure the filename you want is shown in the input box and click ''save''.


== Exploring This Version of ATI's Compressonator Further ==
There is a fuller [https://www.katsbits.com/tutorials/textures/making-dds-using-ati-compressonator.php tutorial] available.
The Compressonator has additional Mip-maps and Compress settings not mentioned above. In particular, the "D3D" and "D3DX" settings use the Microsoft DirectX 3D and DirectX 3D Extension libraries. The version discussed above probably uses version 9 of these. More about version 9 mipmap filtering choices can be found at:
* [https://docs.microsoft.com/en-us/windows/win32/direct3d9/texture-filtering D3D9 Texture Filtering]
* [https://docs.microsoft.com/en-us/windows/win32/direct3d9/texture-filtering-with-mipmaps D3D9 Texture Filtering with Mipmaps]
* [https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dx-filter D3DX Filters]
== Successors ==
=== From ATI ===
The Compressonator's final version 1.50 from ATI (circa Dec 2008; some sites 2010) supports 64-bit Windows.  [https://www.nexusmods.com/oblivion/mods/11852/ Downloadable and Release Notes here]. According to the Release Notes, versions 1.40 - 1.50 use DirectX 3D 10 and its updated Mip-map filtering, and have better support for command line options.


Note that AMD acquired ATI in 2006, and retired the ATI brand by 2010.


== Compressing Normalmaps (for reference) ==
=== AMD's Compressonator ===
{{important|headline=Important|text=The normalmap DDS compression section is here for documentation purposes only. You '''don't''' need to compress the normalmaps for using them in The Dark Mod. <br> '''NEW INFO: RXGB compression is disabled internally as of TDM v1.08 and higher. Do not compress normal maps!''' }}
An up-to-date successor, under Windows 10 and using DirectX 12, "Compressonator 4.0" is an open-source project supportive of AMD's graphic cards:
* Open your source (TGA) file
* [https://gpuopen.com/compressonator/ Project Overview]
* Create Mip Maps using the '''Box-Filter''' with the lowest mip map size of '''1x1''' (same as for the diffuse maps).
* [https://github.com/GPUOpen-Tools/compressonator GitHub source code]
[[Image:01_normal_mips.jpg|frameless]]
* Compress your normalmap using the '''UberCompressor''' in '''DXT5 RXGB''' format with the colour weighting of '''red=0, green=0.5, blue=0.5''' and '''"adaptive" ticked off'''.
[[Image:02_normal_compression.jpg|frameless]]
* Save your DDS to the '''dds/''' tree, e.g. dds/textures/darkmod/stone/blah_local.dds. You won't need to add the dds/ path prefix to your shader definition, this is automatically added by the game.


== See also ==
== See also ==
* [[DDS creation]] for general, tool-independent information about DDS creation. Also, the original wiki page history of content now on this page may be found there.
* [[DDS creation]] for general, tool-independent information about DDS creation. Also, the original wiki page history of content now on this page may be found there.
* [https://en.wikipedia.org/wiki/D3DX More about the various versions of D3DX]
[[Category:Tutorial]]
[[Category:Tutorial]]
[[Category:Textures]]
[[Category:Textures]]

Latest revision as of 01:26, 3 June 2022

Note - Before August, 2020, a longer predecessor of this content lived at DDS creation. Go there for a newly-written tool-independent overview of DDS creation.

Introduction

ATI's "The Compressonator" was important during early TDM development. Now, the version of the program discussed here (indeed, any version under the ATI brand) is old and should not be your first choice, but may still have its uses. See also the "Successors" section at the end.

Find "The Compressonator" version 1.21.1044 here. Install/unzip it to a folder and create a shortcut if you like. (At one time, the foregoing exact version was required, because it alone could compress DXT5 RXGB normalmaps. Compression of normalmaps should no longer be done.)

After running the installer, you will likely find when you try to run "The Compressonator", that the installation was incomplete. To complete it, inspect the distribution .zip for a folder that contains MSVCP71.DLL. With Admin privileges, copy MSVCP71.DLL to where the program lives, typically c:/Program Files (x86)/ATI Technologies Inc/The Compressonator.

Please review DDS creation for general information about

  • working with TGA and DDS, and where files should be placed in your FM
  • suggested DDS creation settings

Compressing Diffuse and Specular Maps

  • Open your source (TGA) file
  • In the Mip Maps toolbar's pulldown, select Box-Filter. Press "Generate", and then a Lowest Mip-Level size of 1x1.

01 mips.jpg

  • In the Compression toolbar's pulldown, select DirectX Texture Compression. Click the "Compress" button.
  • Choose the correct compression type:
    • Diffusemap: Does the texture have transparency(i.e., leaves, spiderwebs, etc)? NO: DXT1. YES: DXT5
    • Specularmap: DXT1 - specular does not require alpha information.
    • Normalmap: NONE - Use TGA!
  • Don't change the default channel weighting values of :
red=0.3086
green=0.6094
blue=0.082
  • Click "Compress"

02 compression.jpg

  • Save your DDS to the /dds/ tree

Change the File Extension to Lowercase

The Compressonator automatically names the file *.DDS, but all files should be lowercase (including TGAs). Be sure to rename the files to a lowercase .dds extension before game testing:

Option A: Use Windows Explorer. You need to change your Explorer settings to display the file extension:

  1. Open up Windows Explorer
  2. Go Tools > Folder Options
  3. Click the View tab and disable Hide extensions for known file types

Then you can highlight your file and hit F2 (or right-click > Rename) and change the extension to lowercase.

Option B: This can also be done via the command line Start > Run... > cmd (then cd to your textures folder) and rename the files via:

ren *.DDS *.dds

About Transparency

At this time TDM only supports hard edges for transparency, so you won't get a gradual blending. However, saving the 8-bit alpha channel - and using DXT5 compression - "future-proofs" your material for a day when TDM could support this smooth blending. In the meantime, hard edge clipping occurs by default at 50%; use the the "alphaTest" keyword in your material to easily control this.

When converting from TGA with Alpha to DDS, the alpha doesn't always work correctly. Causes for this vary, but:

  • One easy workaround is to save your texture out as a TIFF and then open that in The Compressonator.
  • If you are saving from Photoshop/GIMP, disable Layers in the save options, but make sure it's set to preserve transparency.
  • When opening it in The Compressonator, right click in the image and view RGBA/Alpha to check that it is correct, before generating mipmaps or compressing.

Batch Processing

Choose File > Batch Compress or hit F4 to open the batch compression dialog. Choose the same compression settings described above, while taking care to separate file groups that use different compression settings.

Dds batch screenshot.jpg

Command Line Parameters

ATI's compressonator provides some command line parameters to compress the textures:

thecompressonator -convert "specular.tga" "specular.dds" DXT1 -mipmaps 
thecompressonator -convert "diffuse.tga" "diffuse.dds" DXT1 -mipmaps 
thecompressonator -convert "diffuse_with_alpha.tga" "diffuse.dds" DXT5 -mipmaps

Converting From DDS to Common Image File Formats

This is trivial but slightly confusing on The Compressonator:

  • File Menu > Save Original
  • At the bottom of the dialog, below the file name input, select save as type. It may show DDS by default; don't be put off.
  • Select file format from BMP, PNG, or TGA (use TGA generally for Dark Mod.)
  • Make sure the filename you want is shown in the input box and click save.

Exploring This Version of ATI's Compressonator Further

There is a fuller tutorial available.

The Compressonator has additional Mip-maps and Compress settings not mentioned above. In particular, the "D3D" and "D3DX" settings use the Microsoft DirectX 3D and DirectX 3D Extension libraries. The version discussed above probably uses version 9 of these. More about version 9 mipmap filtering choices can be found at:

Successors

From ATI

The Compressonator's final version 1.50 from ATI (circa Dec 2008; some sites 2010) supports 64-bit Windows. Downloadable and Release Notes here. According to the Release Notes, versions 1.40 - 1.50 use DirectX 3D 10 and its updated Mip-map filtering, and have better support for command line options.

Note that AMD acquired ATI in 2006, and retired the ATI brand by 2010.

AMD's Compressonator

An up-to-date successor, under Windows 10 and using DirectX 12, "Compressonator 4.0" is an open-source project supportive of AMD's graphic cards:

See also