DDS

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. Eventually, this format become general in many games to store [[texture compression | compressed t...")
 
Line 1: Line 1:
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK.
+
{{grammar}}
 
+
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. Eventually, this format become general in many games to store [[texture compression | compressed textures]].
Eventually, this format become general in many games to store [[texture compression | compressed textures]].
+
  
 
Darkplaces engine can load DDS storing the images of the following formats:
 
Darkplaces engine can load DDS storing the images of the following formats:
Line 23: Line 22:
 
{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}
 
{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}
  
{{important|DDS files should be a power-of-two textures, thats because some drivers don't deal with non-power-of-two compressed textures (which will result in black walls).}}
+
{{bug|Some drivers don't deal with non-power-of-two compressed textures (can result in black walls). Best way is to always make DDS textures to be [[power-of-two]].}}
  
 
===DDS for NetRadiant===
 
===DDS for NetRadiant===
Line 35: Line 34:
 
     ...
 
     ...
 
  }
 
  }
 +
 +
==Tools==
 +
You can use following tools to produce compressed DDS images:
 +
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
 +
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
 +
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)
  
 
==Console variables==
 
==Console variables==
Line 46: Line 51:
 
* [[texture compression | Texture compression]]
 
* [[texture compression | Texture compression]]
  
 +
[[Category:Glossary]]
 
[[Category:File formats]]
 
[[Category:File formats]]
 
__NOTOC__
 
__NOTOC__

Revision as of 23:57, 29 July 2012


Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. Eventually, this format become general in many games to store compressed textures.

Darkplaces engine can load DDS storing the images of the following formats:

  • BGRA : 32-bit uncompressed image
  • DXT1 : 4-bit compressed DXT1 texture
  • DXT2 : 8-bit compressed DXT2 texture
  • DXT3 : 8-bit compressed DXT3 texture
  • DXT4 : 8-bit compressed DXT4 texture
  • DXT5 : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like TGA or JPEG but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented.

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

dds/textures/mausoleum/outerwall1_1 // override textures/mausoleum/outerwall1_1
dds/models/mapobjects/inn/barrel1_1_norm // override models/mapobjects/inn/barrel1_1_norm
dds/models/mapobjects/inn/barrel1_1 // override models/mapobjects/inn/barrel1_1

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps.

Important: Engine shouldn't try to use mipmaps on this texture (see noPicPip material keyword, also gfx/ images never use mipmaps) or it can crash.
Bug: Some drivers don't deal with non-power-of-two compressed textures (can result in black walls). Best way is to always make DDS textures to be power-of-two.

DDS for NetRadiant

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on brushes, should have separate radiant-only image (see qer_editorImage).

By a convention, radiant-only image should be stored in gamedir/radiant/path_to_base_texture:

textures/town/wall1_1
{ 
    qer_editorImage radiant/textures/town/wall1_1
    ...
}

Tools

You can use following tools to produce compressed DDS images:

Console variables

 r_texture_dds_load : load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).
 r_texture_dds_load_alphamode : trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only
 r_texture_dds_load_logfailure : log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all
 r_texture_dds_save : save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time
 r_texture_dds_swdecode : 0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.

See also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox