Texture Formats

From Dragon Age Toolset Wiki
Jump to: navigation, search

Textures in DAO are stored in the DDS format. Native support of this file type can be added to a graphics package such as Adobe Photoshop or GIMP via the use of plugins. Alternatively, a DDS can be converted into a more universal format such as TGA or JPG using 3rd party tools.

Texture Types

Dragon Age uses a number of different texture types. While all are in the DDS format, they have different purposes. The filename scheme differentiates these types with a suffix. Typically, a texture set for a particular model consists of 4 different types. These are as follows, using the deer model as an example:

c_deera_0d.dds - Diffuse map (d suffix)

c_deera_0n.dds - Normal map (n suffix)

c_deera_0s.dds - Specular map (s suffix)

c_deera_0t.dds - Tint map (t suffix)

Additional texture types are used on some models. The most common type is a height map used on static objects like floors and walls, designated with the h suffix. Other types are emission (glow) maps designated with the e suffix, and fresnel maps utilized by some metallic materials, designated with the f suffix. There's also icon textures, prefixed with ico_

Diffuse Map

This texture holds the base colour information for the model. Diffuse maps are commonly referred to as "skins" in other games. Diffuse maps can be enhanced through the use of the tint system, which overlays a series of colours (defined by the TNT file) on the diffuse map in a pattern defined by the associated tint map.

RGB channels - These hold the colour information, as with any standard image.

Alpha channel - The alpha channel is multi-purpose. Typically it holds transparency information (black is 100% transparency, white is 100% opacity, shades of grey denote values in between), however in some cases, such as face textures, it holds the specular map instead. In these instances there is no separate specular map.

Special cases: Some diffuse maps, notably for hair, do not follow the standard arrangement and are instead what is known as a "packed texture". In these instances, the image is essentially a container for 4 separate greyscale texture maps, one in each channel. These are used in conjunction with the tint system when full colour diffuse maps are not necessary. For example, the hair diffuse map is a packed texture that appears to have the normal map in the red channel, the specular map in the green channel, the alpha map in the blue channel, and the diffuse map in the alpha channel.

DDS Compression: DDS Export Settings

Deer diffuse map

Normal Map

Normal maps are an enhanced version of bump maps, and are used to fake the appearance of additional geometry on a low polygon mesh. They work by providing information on how light would be reflected from a polygon's surface normal (hence the name normal map) as if it were part of a more detailed model. This provides the optical illusion of extra height and depth to otherwise flat geometry. It is typically used to provide roughness to surfaces like rock, or intricate detail like raised filigree patterns on armour and weapons. It is a way of providing highly detailed models without the use of a large number of polygons.

Normal maps used by Dragon Age differ from the typical tangent-space normal maps used in other games. A tangent-space normal map holds X information in the red channel, Y information in the green channel, and Z information in the blue channel. DA normal maps are RGBA with only X and Y information. Z information is interpolated on the fly.

R = Y (same as G channel in regular normal maps)

G = Y (same as G channel in regular normal maps)

B = Y (same as G channel in regular normal maps)

Alpha = X (same as R channel in regular normal maps)

DDS Compression: DDS Export Settings

Deer normal map in DA format
Deer normal map converted to typical RGB format

Specular Map

Specular maps hold information on how an object reflects light. It is sometimes also referred to as a gloss map. Lighting is games does not reflect the true behaviour of light in the real world, thus specular highlights are used to give the illusion of light reflecting off a surface. In simplest terms, it denotes the size and intensity of bright spots on an object, places where light would reflect back in the real world. Objects that should appear very shiny, like polished metal, have high sharp specular highlights, objects that should appear fairly dull, like cloth, have low flat specular highlights.

Specular maps function in a manner not dissimilar to alpha masks, in that the closer to white an area it is, the brighter the highlight. This information is stored in alpha channel of the specular map. The RGB part of the map defines tint applied to the highlight, as not all materials reflect the light equally -- some can reflect the color of the light source, while for others this will be the color of the reflecting object. The tint helps to simulate the latter behavior.

DDS Compression: DDS Export Settings

Deer specular map

Tint Map

Tint maps are another container texture, holding a series of up to 4 greyscale images (RGBA). Each channel is actually an alpha mask. They denote areas of the associated diffuse texture that will be affected by the corresponding tint colour defined in the TNT file.

Commonly only the RGB Channels are used, where one given channel always masks a specific Surface (ie Metal). So that a tint like "Red Steel" can be reapplyable to the full range of armor models, which applies a red tint to only that mask.

Equally, the alpha channel is often only used for skin tints, where applicable.

DDS Compression: DDS Export Settings

RGB channels for deer tint map

Material Object

A texture set for a model is defined in the model's material object or MAO. See the MAO page for more info.

Level of Detail

Most complex models (such as NPCs and creatures) have a scaling level of detail (LOD). As a player moves further away from an object, the LOD is progressively scaled down to reduce system overhead. Both the geometry and textures of a model may have LOD variants. DA uses three LOD levels, denoted by the suffix. The three levels are 0 (highest), 2 and 3 (lowest). For LOD0, the suffix is simply _0x (where x denotes texture type). For LOD2, the suffix is _0xl2 and for LOD3, it is _0xl3. For example, c_deera_0d.dds is a diffuse texture at the highest LOD, c_deera_0dl2.dds and c_deera_0dl3.dds are the LOD2 and LOD3 diffuse textures, respectively. Each LOD texture level is generally 25% the size of the preceding level. For instance, for a LOD0 texture that is 1024x1024, the LOD2 texture will be 512x512 and the LOD3 texture will be 256x256. As well as diffuse maps, LOD is also used for specular and tint maps. Normal maps have no scaling LOD, as they are only used for LOD0.

Scaling LOD for deer diffuse map

Related Links

Reskinning an item tutorial

Material Editor

Material Tint System

External Links

nVidia DDS Plugin for Adobe Photoshop (32bit only) http://developer.nvidia.com/object/photoshop_dds_plugins.html

DDS Plugin for GIMP http://nifelheim.dyndns.org/~cocidius/dds/

DDS Converter v2.1 (DDS conversion tool) http://eliteforce2.filefront.com/file/DDS_Converter;29412

nVidia DDS Utilities (includes DDS conversion tool) http://developer.nvidia.com/object/dds_utilities_legacy.html