DDS Textures (english)

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • DDS = Direct Draw Surface: This Format was introduced by Microsoft as a way of saving textures in DirectX. It can be described as a container for different ways of compressing textures. The most important are the S3 texture compression (DXT1-5) and 3Dc by ATI, as well as other lossless formats. Train Fever primarily uses DXT1, DXT5 as well as 3Dc (ATI2A2XY).

    The most important compression types:


    DXT1RGB5-6-5No alpha channel
    DXT1 (a)RGBA5-6-51 bit alpha
    DXT3RGBA5-6-54 bit alpha
    DXT5RGBA5-6-5Interpolated alpha
    DXT5_NMXY0-6-0-AX is moved to G and Y to alpha
    3DcXYFor normal maps


    1 DXT1


    The texture is divided into 4x4 pixel blocks, so-called texels. Under normal circumstances, these would occupy 16x32 (=512) bit. For 24 bit textures, the 8 empty bits are usually filled internally. A texel block is comprised of the following information: 2x16 bits for 2 colors (RGB565: red 5 bit, green 6 bit, blue 5 bit) and a section with 2 bit per pixel, so 16x2 bit. These 2 bit represent a color matrix of the 2 16 bit colors (these are again upsampled to 24 bit).


    The following is true when an alpha channel is saved:


    Bit patternExplanation
    00Color1
    012/3 color1 + 1/3 color2
    101/3 color1 + 2/3 color2
    11color2


    With DXT1 + alpha, colors 1 and 2 play an additional role. If color2 has a higher value, then the following is true:


    Bit patternExplanation
    00Color1
    011/2 color1 + 1/2 color2
    10transparent/black
    11Color2


    2 DXT3


    Here every texel with a size of 4x4 pixels has access to 128 bits. The first coding is done in the first 64 bit of the alpha channel (4 bit per pixel = 16 gradients per pixel). The second block of 64 bit corresponds to DXT1 without an alpha channel.
    It makes sense to use DXT3 for alpha channels with sharp boundaries. Soft blends are not as easily displayed.


    3 DXT5


    Also makes 128 bits available, but only the alpha channel is interpolated. The first 64 bits are again used by the alpha channel. For colors, two 8 bit values are saved, followed by a block of 16x3 bits for values that are structured similarly to the table for DXT1.
    If the value of color 1 is larger than the value of color 2, then following grades are applicable:


    Bit patternExplanation
    000color1
    0016/7 color1 + 1/7 color2
    0105/7 color1 + 2/7 color2
    0114/7 color1 + 3/7 color2
    1003/7 color1 + 4/7 color2
    1012/7 color1 + 5/7 color2
    1101/7 color1 + 6/7 color2
    111Color2


    If the value of color 2 is larger, the following is applicable:


    bit patternExplanation
    000Color1
    0012/5 color1 + 3/5 color2
    0103/5 color1 + 2/5 color2
    0114/5 color1 + 1/5 color2
    1010
    110255
    111color2


    That means, DXT5 is meant for finer gradients and displays curves better. However, compared to DXT3 , it isn't as sharp and can sometimes lead to blocky artefacts. Most likely you will have to experiment with the types of compression to figure out which one works best for you.


    The compression quality depends on the compression tool itself: how it defines the two colors and how it arranges them.


    4 Normal maps


    Normal maps are a bit more of a challenge. The compression algorithm of DXT often adds unwanted artefacts that can lead to diffused or even destroyed normal maps. To combat that, ATI developed an specific extension.


    5 3Dc


    A normal map is made up of 3 coordinates (X, Y and Z), to better simulate the refraction of light on a surface, therefore enhancing the detail of the surface. For 3Dc only X and Y are saved, as Z can be reconstructed easily, because the length of the vector on normal maps is always equal to 1. That means, for the same compression rate, more space is available per pixel, compared to DXT.
    To make it even more confusing, there are 2 versions of 3Dc. However, the only difference between them is the sequence of the X and Y alignments. The original variant uses FourCc ATI2 (this becomes clear after opening the file in a hex editor). If the channels are switched, then the ATI2 is followed by A2XY. But seeing as this doesn't belong to FourCc, neither Train Fever, nor most tools in general can differentiate. This leads to incorrect normal maps in the game itself. Another downside, is that only very few tools support the format, such as the standalone version of nVidia's DDS compressor or Intel's Texture Works plugin for Adobe Photoshop. NVidia's Photoshop plugin only supports ATI2.
    3Dc ATI2A2XY is the Transport Fever standard used for normal maps. To use these compressions, one of the new PHYSICAL_ materials must be used.


    6 Why do I need to know this?


    Good question. If some areas are extremely smeared or a certain label or inscription is no longer legible, then using certain properties of the DXT format can be very useful. The texel size of 4 is the first way: simply moving the label or sharp edge by one or perhaps two pixels can already change the way it is being compressed. Overfilling the UV area by 8 pixels or more, along with optimizing same colors at seams is recommended. These areas also influence the two reference colors.


    7 Which format is used for what?


    DXT1 has the best compression ratio (6:1 for 24 bit textures, 8:1 for 32 bit textures), but can only offer a 'yes' or 'no' in your alpha channel. For textures with an alpha channel it is best to only use it if a transparency of 100% is desired. For textures without an alpha channel (dirt, rust, CBlend, METAL, GLOSS, AO, etc.) it is definitely the best choice because of the effective compression.
    If an alpha channel is a requirement, then you'll have to decide if you want to use DXT3 or DXT5. Both compress in the same 4:1 ratio. Another possibility is to create a separate window or glass texture (for example: 16x16 pixels) in another file, so the rest can be compressed with DXT1. The downside to that is, you'll need a more detailed mesh, which also can hinder performance. It's up to you. :)
    For normal maps, 3Dc is the way to go. But if you aren't using the new PHYSICAL_ materials, sticking to DT1 or TGA is better. DXT5_NM is not supported by Transport Fever.


    8 Compression tools


    Tool3Dc - version
    NVIDIA Texture ToolsPhotoshop Plugin
    Paint Shop Pro plugin
    ATI2Download
    Intel Texture WorksPhotoshop pluginATI2A2XYDownload
    Gimp DDSGimp pluginATI2Download
    NVIDIA DDS UtilitiesStandaloneATI2A2XYDownload
    AMD CompressStandalone / GUIATI2
    ATI2A2X
    Download



    9 Additional links


    http://alt.3dcenter.org/artikel/3dc/index5.php
    http://www.nvidia.com/object/r…-map-dxt-compression.html
    https://en.wikipedia.org/wiki/S3_Texture_Compression

Share