Difference between revisions of "DDS Files"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Madcat221
imported>Ethatron
 
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
;DDS : The Microsoft DirectDraw Surface (.dds) file format.
'''DDS''' is the file extension used to denote the Microsoft DirectDraw Surface (.dds) texture file format.


Oblivion employs the DDS format for textures. The Microsoft DirectDraw Surface (.dds) file format stores textures and cubic environment maps, with or without mipmaps. It was introduced with DirectX 7.0.  
Oblivion employs the DDS format for textures. The Microsoft DirectDraw Surface (.dds) file format stores textures and cubic environment maps, with or without mipmaps. It was introduced with DirectX 7.0.  


Although the format is not natively supported by most graphic editing applications, there are a number of [[DDS_Tools|Tools]] designed to handle the format.
Although the format is not natively supported by most graphic editing applications, there are a number of [[DDS_Tools|Tools]] designed to handle the format.
== Types of textures ==
There are at least several types of the DirectX textures and their equivalent in the shaders. Note that the textures should contain mipmaps (the same texture copied several times but with lower resolution down to almost a single pixel).
If the mipmap is not present in the texture file then it will be generated on the fly (adding some stress to the CPU/GPU).
If the texture is 1x2 and shader requests color from the middle of that texture then it should get interpolated value (in that case average of the both pixels).
=== 2D texture ===
Standard flat texture. It has 2 dimensions (X,Y), can hold 4 colors (Red, Green, Blue, Alpha) and multiple mipmaps. Example: Texture 64x32 with mipmaps 32x16, 16x8, 8x4, 4x2, 2x1.
Declared in shader assembler as dcl_2D.
=== 2D texture array ===
Probably not supported by Oblivion's engine thus not described here.
=== 3D texture (volume texture) ===
The same as 2D texture but has 3 dimenzions (X,Y,Z). Every layer of pixels in Z dimension is stored as a separate image called slice. Example: Texture 16x8x4 with mipmaps 8x4x2, 4x2x1.
Declared in shader assembler as dcl_volume.
=== 3D cube texture ===
6 textures that are laid on the sides of a cube. (needs more info about that).




Line 17: Line 36:
|Textures without Transparency
|Textures without Transparency
(Most Models and all Landscape)
(Most Models and all Landscape)
|DXT1
|DXT1,
RGB
RGB
|Yes
|Yes
Line 47: Line 66:
|Yes
|Yes
|Tangent Space
|Tangent Space
|Gloss
|Specular shine
(Black = Plastic, White = Mirror)
(Black = no shine, White = high shine)<br />
Glossiness is controlled through a mesh's NiMaterialProperty in the NIF file
|-
|-
|Glow Maps  
|Glow Maps  
Line 76: Line 96:
|-
|-
|Loading Screens
|Loading Screens
|DXT5
|DXT1
RGB
RGB
|No
|No
Line 83: Line 103:
|}
|}


NOTES: Normal Maps don't necessarily need to be saved as DXT3, you can save a normal map as DXT1 No Alpha if you don't need the alpha channel.
NOTES: Compression for the RGB channels does not differ significantly between DXT1, 3, and 5.  The main differences lie in the manner in which the alpha channel is compressed.  DXT1 compresses the alpha map as all-black/white, which is highly compressible.  DXT1 has a two-bit alpha channel, either white ("Implicit") or black (the color-channels are set to 0).  DXT3 has a larger grayscale available ("Explicit"), and DXT5 has as wide an alpha map grayscale as it has for the color channels ("Interpolated").
This will give you a smaller file, with no gloss effect whatsoever though.
 
Because of this, saving a Normal map as DXT1 has the unwanted side effect of causing full specular highlighting over the whole mesh to which the texture is assigned to.  DXT3 or DXT5 are strongly recommended for normal maps.
 
Though both DXT3 and DXT5 have alpha channels that can function as specular maps, DXT3 has a noticeable step in the gradients; DXT5's more gradual gradient may be better suited to some situations.


DXT5 can also function as a normal map format.  DXT3 uses an Explicit alpha map, which has a noticeable step in the grayscale gradients of the map.  DXT5 uses an Interpolated alpha map, which does not have this step and may be better suited for some situations.
Though parallax mapping and transparency can function at the same time, the formats in which the alpha channel must be configured for the two effects is usually incompatible and may produce unwanted effects.


Though parallax and transparency mapping can function at the same time, the formats in which the alpha channel must be configured for the two effects is usually incompatible and may produce unwanted effects.
Oblivion can also use uncompressed texture files, specifically 8.8.8.8 Unsigned format.  This completely eliminates compression artifacts not pre-existing, but is significantly larger in file size (and thus harder on the video RAM resources).  You may be able to afford reducing the size of the texture to a smaller size since there are no DXT compression artifacts to be concerned about.


== See Also ==
== See Also ==
*[http://obge.paradice-insight.us/wiki/Modder%27s_Manual OBGEs Integrated texture converter]
*[[DDS Tools]]
*[http://en.wikipedia.org/wiki/S3TC DXTn Info @Wikipedia]
*[[Choose the right DXTC compression algorithm]]
*[http://www.invision.tesalliance.org/forums/index.php?/topic/1139-guest-workshop-texturing-101-by-vince/page__hl__Texturing__fromsearch__1 Texturing 101 at TES Alliance]


[[DDS Tools]]
<BR>[http://en.wikipedia.org/wiki/S3TC DXTn Info @Wikipedia]
[[Category:Data_Files]]
[[Category:Data_Files]]
[[Category:Textures]]
[[Category:Textures]]
[[Category:Glossary]]

Latest revision as of 12:46, 19 January 2012

DDS is the file extension used to denote the Microsoft DirectDraw Surface (.dds) texture file format.

Oblivion employs the DDS format for textures. The Microsoft DirectDraw Surface (.dds) file format stores textures and cubic environment maps, with or without mipmaps. It was introduced with DirectX 7.0.

Although the format is not natively supported by most graphic editing applications, there are a number of Tools designed to handle the format.

Types of textures[edit | edit source]

There are at least several types of the DirectX textures and their equivalent in the shaders. Note that the textures should contain mipmaps (the same texture copied several times but with lower resolution down to almost a single pixel). If the mipmap is not present in the texture file then it will be generated on the fly (adding some stress to the CPU/GPU). If the texture is 1x2 and shader requests color from the middle of that texture then it should get interpolated value (in that case average of the both pixels).

2D texture[edit | edit source]

Standard flat texture. It has 2 dimensions (X,Y), can hold 4 colors (Red, Green, Blue, Alpha) and multiple mipmaps. Example: Texture 64x32 with mipmaps 32x16, 16x8, 8x4, 4x2, 2x1. Declared in shader assembler as dcl_2D.

2D texture array[edit | edit source]

Probably not supported by Oblivion's engine thus not described here.

3D texture (volume texture)[edit | edit source]

The same as 2D texture but has 3 dimenzions (X,Y,Z). Every layer of pixels in Z dimension is stored as a separate image called slice. Example: Texture 16x8x4 with mipmaps 8x4x2, 4x2x1. Declared in shader assembler as dcl_volume.

3D cube texture[edit | edit source]

6 textures that are laid on the sides of a cube. (needs more info about that).


DDS Settings used by Oblivion[edit | edit source]

Usage Save Format Mip Maps Image Type Use of Alpha Channel
Textures without Transparency

(Most Models and all Landscape)

DXT1,

RGB

Yes Color map -
Textures with optional Transparency

(Needs to be activated in NIF-File)

DXT3, DXT5

ARGB

Yes Color map Transparency

(Black = Invisible,
White = Opaque)

Textures with Parallax displacement mapping

(must be activated in NIF file)

DXT3, DXT5

ARGB

Yes Color map Displacement mapping

(Black = recessed,
White = raised,
50% gray = baseline)

Normal Maps

(*_n.dds)

DXT3, DXT5

ARGB

Yes Tangent Space Specular shine

(Black = no shine, White = high shine)
Glossiness is controlled through a mesh's NiMaterialProperty in the NIF file

Glow Maps

(*_g.dds)

DXT1

RGB

Yes Color map -
Icons

(And other GUI elements)

DXT3

ARGB

No Color map Transparency in GUI

(e.g. Weapon Icons)

BookArt DXT3

ARGB

No Color map Transparency on Page

(Show Book's Background Texture)

Loading Screens DXT1

RGB

No Color map -

NOTES: Compression for the RGB channels does not differ significantly between DXT1, 3, and 5. The main differences lie in the manner in which the alpha channel is compressed. DXT1 compresses the alpha map as all-black/white, which is highly compressible. DXT1 has a two-bit alpha channel, either white ("Implicit") or black (the color-channels are set to 0). DXT3 has a larger grayscale available ("Explicit"), and DXT5 has as wide an alpha map grayscale as it has for the color channels ("Interpolated").

Because of this, saving a Normal map as DXT1 has the unwanted side effect of causing full specular highlighting over the whole mesh to which the texture is assigned to. DXT3 or DXT5 are strongly recommended for normal maps.

Though both DXT3 and DXT5 have alpha channels that can function as specular maps, DXT3 has a noticeable step in the gradients; DXT5's more gradual gradient may be better suited to some situations.

Though parallax mapping and transparency can function at the same time, the formats in which the alpha channel must be configured for the two effects is usually incompatible and may produce unwanted effects.

Oblivion can also use uncompressed texture files, specifically 8.8.8.8 Unsigned format. This completely eliminates compression artifacts not pre-existing, but is significantly larger in file size (and thus harder on the video RAM resources). You may be able to afford reducing the size of the texture to a smaller size since there are no DXT compression artifacts to be concerned about.

See Also[edit | edit source]