Home

Awesome

GPURealTimeBC6H

Real-time BC6H compressor which runs on a GPU. Includes a small testbed application. This compressor is used in a few released AA/AAA games.

Compressor has two presets:

How It Works

BC6H is a pretty complex format with multiple possible block modes. To prune search space a bit one mode was selected for the fast compression setting(mode 11) and two for the quality compression setting (mode 2 and mode 6) which proved to have the best trade off between quality and performance.

Fast mode is based on computing a color bounding box ("Real-Time DXT Compression" by J.M.P. van Waveren, 2006), then ordering colors by a diagonal of this bounding box and using least square fit to find optimal endpoints ("High Quality DXT Compression using CUDA" by Ignacio Castaño, 2007). All computations are made in log2 space in order to optimize for perceptual error (after all resulting image will be tone mapped).

Quality mode has two passes. First pass searches for a best partition by computing color bounding box per partition and computing error as distance of every texel from that line. In the second pass best partition is encoded using similar approach as the fast mode.

Quality

Quality compared using RMSLE (lower is better).

GPU Real-Time BC6H "Fast"GPU Real-Time BC6H "Quality"Intel "Very fast"Intel "Fast"Intel "Basic"Intel "Slow"Intel "Very slow"DirectXTex
Atrium0.00740.00660.00800.00690.00670.00670.00670.0079
Backyard0.00730.00700.00720.00670.00650.00650.00650.0075
Desk0.04470.03280.04700.03070.02980.02940.02930.0413
Memorial0.01580.01260.01920.01350.01330.01320.01310.0243
Yucca0.01680.01230.01450.01080.01050.01030.01030.0124

License

This work is dual-licensed under either public domain or MIT.