Fast Texture Compression
Features / Description
Texture compression is a technique to reduce bandwidth and decrease texture storage requirements. Decompression of modern formats is fast, efficient, and usually done in hardware. Conversely, compression is usually done offline and consumed at runtime. The goal of fast texture compression is to improve the efficiency of content pipelines and allow compression to be performed at runtime without significant quality loss.
Simple formats, such as DXT1 (aka BC1), can be compressed with both CPU and GPU implementations. Using SSE2 instructions allows CPU implementations to reach compression speeds that can be used at runtime to compress generated textures such as frame buffers or procedural textures. More complicated formats, such as BPTC (aka BC7) cannot be compressed at runtime due to their complexity. Until recently, BC7 compression algorithms required a large amount of computational resources, mainly due to the complexity of the format. Real-time graphics content pipelines may have hundreds, if not thousands, of textures. This large amount of content requires a compression algorithm that runs in seconds, and not minutes, per texture.
Fast texture compression algorithms can be implemented on both the CPU and the GPU. While GPU implementations are usually faster, current implementations do not provide the same quality as CPU versions, specifically for BPTC. The type of implementation should be chosen based on the workload and the desired quality of the decompressed image. You may find that one implementation fits better in your rendering workflow than another.
This sample demonstrates both a real-time DXT1 compressor and an accelerated BPTC compressor. Both use SSE2 for vectorization and data parallelism as well as threading to scale to available cores.
- CPU: Intel® Core™ i5 or better suggested
- GPU: Microsoft DirectX* 9c capable graphics card
- OS: Microsoft Windows* 7 or Microsoft Windows* 8 (x64 recommended)
- Memory: 2 GB of RAM or better
Software requirements for binary:
- Redistributables: Microsoft Visual C++* 2010 SP1 Redistributable Package (x86 or x64), DirectX End-User Runtimes (June 2010)
Software requirements for building:
- Compilers supported: Microsoft Visual Studio* 2010 w/ SP1, Microsoft Visual Studio* 2012, Intel® C++ Compiler version 11
- Libraries required: Microsoft DirectX* SDK (June 2010)
Fast Texture CompressionDOWNLOAD PROJECT
Related Technical Articles
This software is subject to the U.S. Export Administration Regulations and other U.S. law, and may not be exported or re-exported to certain countries (Burma, Cuba, Iran, Libya, North Korea, Sudan, and Syria) or to persons or entities prohibited from receiving U.S. exports (including Denied Parties, Specially Designated Nationals, and entities on the Bureau of Export Administration Entity List or involved with missile technology or nuclear, chemical or biological weapons).