With this How To we will show how to create and use the latest versions of DDS (Direct Draw Surface) Textures with Ventuz. DDS Textures can be used in order to save performance and VRAM as they can be written to the graphics card memory directly and in compressed state.
From now on we support way more so called Block Compression modes (BCn). The old term DXTn is now replaced by BCn where “n” is the Level.
You can use a DDS Texture in Ventuz like you can use any other image file format.
With the change and update to DirectX 11 for our graphics engine and the support of the latest BC modes we are able to use all currently available compression modes. Please see the following table for reference:
Source data | Minimum required data compression resolution | Recommended format | Minimum supported feature level | D3D 9 equivalent |
Three-channel color with alpha channel | Three color channels (5 bits:6 bits:5 bits), with 0 or 1 bit(s) of alpha | BC1 | Direct3D 9.1 | DXT1 |
Three-channel color with alpha channel | Three color channels (5 bits:6 bits:5 bits), with 4 bits of alpha | BC2 | Direct3D 9.1 | DXT2,DXT3 |
Three-channel color with alpha channel | Three color channels (5 bits:6 bits:5 bits) with 8 bits of alpha | BC3 | Direct3D 9.1 | DXT4, DXT5 |
One-channel color | One color channel (8 bits) | BC4 | Direct3D 10 | ATI1 |
Two-channel color | Two color channels (8 bits:8 bits) | BC5 | Direct3D 10 | ATI2 |
Three-channel high dynamic range (HDR) color | Three color channels (16 bits:16 bits:16 bits) in “half” floating-point* | BC6H | Direct3D 11 | N/A |
Three-channel color, alpha channel optional | Three color channels (4 to 7 bits per channel) with 0 to 8 bits of alpha | BC7 | Direct3D 11 | N/A |
*”Half” floating-point is a 16 bit value that consists of an optional sign bit, a 5 bit biased exponent, and a 10 or 11 bit mantissa.
Most of these formats allow either Linear and/or sRGB. The BC4 is meant to be used for grayscale images like a heightmap, roughness or ambient occlusion textures. If you want to achieve the highest quality and most lossless texture you should go for BC7 Fine.
To export DDS files with the latest support of BC Levels, we suggest the Intel Texture Works Plugins for Photoshop, which can be found here
After installing the Intel Texture Works Plugin, you can create or convert your textures by choosing the Intel Texture Works DDS Type from the Save as type dropdown:
By choosing a filename and clicking the save dialog, another dialog will pop up and ask you for the Texture Type and Compression. See available types and formats;
You can go for any of the available types and compressions. The decision should be made according to the usage of the texture. A simple heightmap should not be saved with BC7 since you will mostly use a grayscale image only. In this case a BC4 linear grayscale would be the perfect match.
On the ''Intel Texture Works Plugin'' homepage is a very good table with hints about each type of BC and their usage :
BC1 | RGB | 4BPP | aka DXT1 | Useful for color maps or normal maps if memory is tight. Contains RGB types of data |
BC1 | sRGB | 4BPP | aka DXT1 | Same as above with sRGB extended header only on DX10 + level hardware |
BC3 | RGBA | 8BPP | aka DXT5 | Useful for color maps with full alpha, packing color and mono maps together. Contains RGBA types of data. |
BC3 | sRGBA | 8BPP | aka DXT5 | Same as above with sRGB extended header only on DX10 + level hardware |
BC4 | R 4BPP | Grayscale | Useful for height maps, gloss maps, font atlases or any other grayscale image | |
BC5 | RG | 8BPP | aka 3Dc | Useful for tangent space normal maps. A two Channel Tangent Map |
BC6H | RGB | 8BPP | Fast Compression Useful for HDR 16 images only on DX11+ level hardware | |
BC6H | RGB | 8BPP | Fine Compression Same as above with longer optimized compression time for a finer result | |
BC7 | RGBA | 8BPP | Fast Compression Useful for high quality color maps, color maps with full alpha. It provides the best quality compression only on DX11+ level hardware | |
BC7 | RGBA | 8BPP | Fine Compression Same as above with longer optimized compression time for a finer result | |
BC7 | sRGBA | 8BPP | Fast Compression Same as BC7 Fast above with sRGB extended header only on DX10 + level hardware | |
BC7 | sRGBA | 8BPP | Fine Compression Same as BC7 Fine above with sRGB extended header only on DX10 + level hardware | |
None | RGBA | 32BPP | Uncompressed |
For cubemaps, the texture size need to be a power of two. Else writing the texture is not possible without an error and the image can not be loaded correctly.
To check if the textures are written correctly and/or valid, you can use the DDS View. A precompiled version of the DDSView is available here. The source code can be found here. The tool requires the Visual Studio 2015 Redistributables. Drag & drop any DDS File onto the DDSView.exe. As long as it is a valid and working DDS File it will show it.
In this How To we have given you an overview of the creation and usage of DXT compressed textures and the use cases of each compression type. The user can use the information to implement a workflow that allows for better performance than simple PNG or JPG encoded pictures.