DDS
Twinchenzo (Talk | contribs) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{grammar}} | + | {{grammar checked|darth}} |
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. | Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. | ||
− | Darkplaces engine can load DDS storing | + | Darkplaces engine can load DDS storing images of the following formats: |
* '''BGRA''' : 32-bit uncompressed image | * '''BGRA''' : 32-bit uncompressed image | ||
* '''DXT1''' : 4-bit compressed DXT1 texture | * '''DXT1''' : 4-bit compressed DXT1 texture | ||
Line 10: | Line 10: | ||
* '''DXT5''' : 8-bit compressed DXT5 texture | * '''DXT5''' : 8-bit compressed DXT5 texture | ||
− | In Darkplaces, DDS | + | In Darkplaces, DDS is not a 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 present. |
All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture: | All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture: | ||
Line 18: | Line 18: | ||
dds/models/mapobjects/inn/barrel1_1 <font color=green>// override models/mapobjects/inn/barrel1_1</font> | dds/models/mapobjects/inn/barrel1_1 <font color=green>// override models/mapobjects/inn/barrel1_1</font> | ||
− | DDS files should have mipmaps pre-generated. If there | + | DDS files should have mipmaps pre-generated. If there are no mipmaps generated, it is implied that this texture is not using mipmaps. |
− | {{important|Engine shouldn't try to use mipmaps | + | {{important|Engine shouldn't try to use mipmaps if they do not exist in DDS (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it may crash.}} |
− | {{bug|Some drivers don't deal with non-power-of-two compressed textures ( | + | {{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}} |
===DDS for NetRadiant=== | ===DDS for NetRadiant=== | ||
Line 56: | Line 56: | ||
[[Category:Glossary]] | [[Category:Glossary]] | ||
[[Category:File formats]] | [[Category:File formats]] | ||
+ | {{finished}} | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 16:34, 28 September 2012
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store compressed textures.
Darkplaces engine can load DDS storing 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 is not a 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 present.
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 are no mipmaps generated, it is implied that this texture is not using mipmaps.
[edit] 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 ... }
[edit] Tools
You can use following tools to produce compressed DDS images:
- RwgTex - recommended commandline tool used by Blood Omnicide
- ATI Compressonator
- PVRTexTool (requires registration)
[edit] Future alternatives
In 2010 Khronos group introduced KTX format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.