KatsBits Community

Custom DDS textures showing as 'black'

kat · 1 · 13094

0 Members and 1 Guest are viewing this topic.

Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2708
    • KatsBits
If you've got some custom textures which need their DDS counterparts doing you may (have) run into this problem where textures appear 'black' in both the editor and the game. This happens because the wrong compression algorithm has been used on one of the images; usually the normalmap is at fault because it uses a 'special' algorithm that only ATI's Compressonator can process, using anything else tends to 'black' out the images when used.

It's best to use the command prompt to process the normalmap so you're using exactly the same settings id software used for their assets; using the Compressonators interface may introduce settings that are not needed or one that just interfere with the 'base' settings.

DDS settings for normalmaps
The settings used for DDS compressing the normalmap are;

Code: [Select]
-convert "[b]normal.tga[/b]" "[b]normal.dds[/b]" RxGB +red 0.0 +green 0.5 +blue 0.5 -mipmaps
"normal.tga" and "normal.dds" refer to the file path locations and name of the assets loaded as a tga and then saved as a dds;

Code: [Select]
C:\\assets\textures\walls\wall_trim_normal.tga
C:\\assets\textures\walls\dds\wall_trim_normal.dds

So you can load an image from one location and save it to another.

Command Prompt

If you've never used the Command Prompt before it's used as follows; this assumes a Windows XP machine with the Compressonator installed to C:Program FilesATIThe Compressonatorthecompressonator.exe

Code: [Select]
Start » Programs » Accessories » Command Prompt (WinXP)
The default directory is usually shown as;
Code: [Select]
C:\\Documents and Settings\[user] That needs to be changed so it's showing the folder in which the Compressonator program is sitting;

Code: [Select]
Enter 'cd..', without the quotes, twice (or the number of times required to get back to the root C: drive)
Once there we need to travel up the directory structure to get to the correct folder like so;
Code: [Select]
cd Program Files [return/enter]
cd ATI [return/enter]
cd The Compressonator [return/enter]

This will bring us to the root folder of the Compressonators installation;

Code: [Select]
C:\\Program Files\ATI\The Compressonator\>
And have us ready to use the DDS settings mentioned above to process the normalmaps. This is done as follows. At the command prompt, type the following;

Code: [Select]
thecompressonator.exe -convert "[file/path/to/load]normal.tga" "[file/path/to/save]normal.dds" RxGB +red 0.0 +green 0.5 +blue 0.5 -mipmaps
If a file path isn't set for the save location the program defaults to saving in the Compressonators own folder.

Other DDS compression settings

  • Diffuse - no alpha = DXT1
  • Diffuse - alpha = DXT3
  • Specular - no alpha = DXT1
  • Specular - alpha = DXT3
  • Height - no alpha = DXT1
  • Height - alpha = DXT3
Written at command prompt like so;

Code: [Select]
thecompressonator.exe -convert "[file/path/to/load]diffuse.tga" "[file/path/to/save]diffuse.dds" DXT1 -mipmaps

thecompressonator.exe -convert "[file/path/to/load]diffuse_alpha.tga" "[file/path/to/save]diffuse_alpha.dds" DXT3 -mipmaps

Specular and Height maps are treated in the same way as the diffuse.