DDS Image: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
No edit summary
imported>Ikskoks
 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Game_Legendary Hunter VR | Game: Legendary Hunter VR]]
== DDS ==
[[Category:Complete_Complete | Status: Complete]]
[[Category:Extension_pak | Extension: pak]]
{{CompactGRAFTOC}}


<div style="border:solid 1px #AAAAAA; padding:4px; background-color:#F9F9F9;">
* ''' Format Type ''':   Image / Texture<br>  
<i>Format Type:</i> Image<br />
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
<i>Extensions:</i> dds<br />
* ''' Signature ''':   DDS <br>  
<i>Platforms:</i> <i>unknown</i><br />
 
<i>Endian Order:</i> Little Endian
 
</div>
=== Format Specifications ===
[[Category:Format_Archive | Type: Archive]]
 
<br /><br />
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:1000px; overflow:auto;">
== Format Specifications ==
<pre>
<pre>
DirectX DDS Image
// DDS file format
 
// little endian
 
4 bytes (char) - signature // "DDS "
 
// surface format header
4 bytes (uint32) - header size  // "124"
4 bytes - flags      // DDSD_CAPS, DDSD_PIXELFORMAT, DDSD_WIDTH and DDSD_HEIGHT flags are required
4 bytes (uint32) - height in pixels
4 bytes (uint32) - width in pixels
4 bytes (uint32) - pitch or linear size    // calculated from equation
                                          // see notes below for details
                                          // pitch can be "0"
4 bytes (uint32) - depth of the volume  // can be "0"
4 bytes (uint32) - number of mipmaps
44 bytes - reserved
 
// pixel format structure (32 bytes)
4 bytes (uint32) - structure size  // always 32
4 bytes - flags
4 bytes (char) - compression type  // "DXT1", "DXT2", "DXT3", "DXT4", "DXT5" or nulls for no compression
4 bytes (uint32) - RGB bit count  // 16, 24, or 32
4 bytes (uint32) - R bit mask
4 bytes (uint32) - G bit mask
4 bytes (uint32) - B bit mask
4 bytes (uint32) - A bit mask
 
 
// capabilities structure (16 bytes)
4 bytes (uint32) - caps 1
4 bytes (uint32) - caps 2
4 bytes (uint32) - reserved 1
4 bytes (uint32) - reserved 2
 
 
4 bytes (uint32) - reserved
 
 
x bytes - image data / main surface data
 
 
// additional surfaces (optional)
num_of_surfaces *
{
  x bytes - additional surfaces data
}
</pre>
</pre>
<br /><br />
</div>
== MultiEx BMS Script ==
 
=== MultiEx BMS Script ===
 
Not written yet.
 
=== Notes and Comments ===
 
* DDS texture can have additional surfaces (mipmaps) which should always be smaller than the main surface.
 
=== Pitch calculation ===  


<tt>
For block-compressed formats, compute the pitch as: <br>
<i>No BMS script</i>
'''max( 1, ((width+3)/4) ) * block-size''' <br>
</tt>
The block-size is 8 bytes for DXT1, BC1 and BC4 formats <br>
<br /><br />
but 16 bytes for other block-compressed formats. <br><br>
[[Category:BMS_None | BMS: None]]
== Supported Programs ==


* [[Game Extractor|Game Extractor]]<br />
For R8G8_B8G8, G8R8_G8B8, legacy UYVY-packed, and legacy YUY2-packed formats: <br>
<br /><br />
'''((width+1) >> 1) * 4''' <br><br>
[[Category:Program_Game_Extractor | Program: Game Extractor]]
== Notes ==


<i>No additional notes</i>
For other formats: <br>
<br /><br />
'''( width * bits-per-pixel + 7 ) / 8''' <br>
[[Category:CE_None | Compression: None]]
== Games ==


=== Games ===
List of games using this file format:


* 0 A.D. (*.DDS) (PC)
* Disney Sing It (*.TEX)
* Rigs of Rods (*.DDS) (PC)
* Star Stable Online
* Many more...


<br /><br />
=== Compatible Programs ===  
== Navigation ==


{{Format Navigation}}
* IrfanView
<br /><br />
* GIMP
* Adobe Photoshop
* XnView MP
* Windows Texture Viewer
* paint.NET
* DDS File Viewer
<br/><br>




[[Category:Complete Complete|DDS Image]]
[[Category:Platform PC|DDS Image]]
[[Category:CE None|DDS Image]]
[[Category:CE Compressed|DDS Image]]
[[Category:DXT1 compression]]
[[Category:DXT2 compression]]
[[Category:DXT3 compression]]
[[Category:DXT4 compression]]
[[Category:DXT5 compression]]
[[Category:Format_Image | Type: Image]]
[[Category:Extension_dds | Extension: dds]]
[[Category:BMS_None | BMS: None]]
[[Category:File Format]]
[[Category:File Format]]

Latest revision as of 20:55, 16 July 2023

DDS

  • Format Type : Image / Texture
  • Endian Order : Little Endian
  • Signature : DDS


Format Specifications

// DDS file format

// little endian

4 bytes (char) - signature // "DDS "

// surface format header
4 bytes (uint32) - header size  // "124"
4 bytes - flags      // DDSD_CAPS, DDSD_PIXELFORMAT, DDSD_WIDTH and DDSD_HEIGHT flags are required
4 bytes (uint32) - height in pixels
4 bytes (uint32) - width in pixels
4 bytes (uint32) - pitch or linear size    // calculated from equation
                                           // see notes below for details
                                           // pitch can be "0"
4 bytes (uint32) - depth of the volume  // can be "0"
4 bytes (uint32) - number of mipmaps
44 bytes - reserved

// pixel format structure (32 bytes)
4 bytes (uint32) - structure size  // always 32
4 bytes - flags
4 bytes (char) - compression type   // "DXT1", "DXT2", "DXT3", "DXT4", "DXT5" or nulls for no compression
4 bytes (uint32) - RGB bit count   // 16, 24, or 32
4 bytes (uint32) - R bit mask
4 bytes (uint32) - G bit mask
4 bytes (uint32) - B bit mask
4 bytes (uint32) - A bit mask


// capabilities structure (16 bytes)
4 bytes (uint32) - caps 1
4 bytes (uint32) - caps 2
4 bytes (uint32) - reserved 1
4 bytes (uint32) - reserved 2


4 bytes (uint32) - reserved


x bytes - image data / main surface data


// additional surfaces (optional)
num_of_surfaces *
{
   x bytes - additional surfaces data
}

MultiEx BMS Script

Not written yet.

Notes and Comments

  • DDS texture can have additional surfaces (mipmaps) which should always be smaller than the main surface.

Pitch calculation

For block-compressed formats, compute the pitch as:
max( 1, ((width+3)/4) ) * block-size
The block-size is 8 bytes for DXT1, BC1 and BC4 formats
but 16 bytes for other block-compressed formats.

For R8G8_B8G8, G8R8_G8B8, legacy UYVY-packed, and legacy YUY2-packed formats:
((width+1) >> 1) * 4

For other formats:
( width * bits-per-pixel + 7 ) / 8

Games

List of games using this file format:

  • 0 A.D. (*.DDS) (PC)
  • Disney Sing It (*.TEX)
  • Rigs of Rods (*.DDS) (PC)
  • Star Stable Online
  • Many more...

Compatible Programs

  • IrfanView
  • GIMP
  • Adobe Photoshop
  • XnView MP
  • Windows Texture Viewer
  • paint.NET
  • DDS File Viewer