BC6 Texture Compression tool for application on vector fields. Reads 3D and 4D datasets of 3-component floating point vectors and applies BC6H texture compression. This allows to use fast native GPU decompression when accessing the data without the need for prior decompression.
The tool previews the source and compressed datasets in image representation and allows to calculate a simple quality estimate. Datasets can be read from HDF5, RAW and KTX. They can be saved to RAW, KTX and VTK formats.
- Compress/Decompress BC6H
- Read HDF5, RAW and KTX
- Save RAW, KTX and VTK
- Dataset preview
- Quality estimation
- Load file or generate ABC dataset
- Optionally: Normalize dataset to range
[0, 1]
- Choose compression quality preset
- Compress
- Optionally: Measure distance/component error
- Save
HDF5 data is expected to describe vectors of 3 components. Each component is loaded seperately. They can reside in the same dataset in which case a corresponding stride and offset have to be given.
- Enter path to dataset in text field next to
Select HDF5
button - Press
Select HDF5
button - View HDF5 File Structure on the right
- Enter paths for the
[X|Y|Z]
datasets - Optionally: Choose custom strides/offsets
RAW data is expected to describe the dataset dimensions (X, Y, Z, T)
as integers first (in that order) and subsequently the dataset.
For a dataset datasetname.raw
dimensions can also be given via a seperate file with the naming convention datasetname_dims.raw
(in this case, the data file must not contain dimensions).
The number of channels is calculated automatically based on the filesize and dimensions.
- Press
Load
button - Select data type:
[Source|Normalized|Peaks|Compressed|Decoded|Error]
- Give path to dataset
- Press
Load
button
KTX data is expected to be given according to the official specs.
- Press
Load
button - Select data type:
[Source|Normalized|Peaks|Compressed|Decoded|Error]
- Give path to dataset
- Press
Load
button
Data can be saved in VTK, RAW and KTX format. Exceptions are the "peaks" data (extrema) generated for normalization/denormalization and the BC6H encoded data. Peaks are saved as a binary array of floats without any dimension info. BC6H encoded data cannot be saved as VTK. Additionally, VTK doesn't support 4D data so the supported datasets generate a seperate VTK file for each timestep containing the respective 3D state of the dataset.
Moreover, data is per default stores in "interleaved" format, i.e., the data is saved as (x, y, z)
vectors.
In RAW format the data can be saved non-interleaved, where each component is saved as seperate 4D datasets concatenated as a single file.
- Press
Save
button - Select data type:
[Source|Normalized|Peaks|Compressed|Decoded|Error]
- Give path to dataset
- Select output type:
[KTX|Raw|VTK]
- Optionally: If
Raw
, select whether to save the dataset non-interleaved - Press
Save
button
To compress a loaded dataset, choose a quality preset and press the Compress BC6H
button.
The tool allows to compress either the Source
or the Normalized
dataset.
To compress Source
, leave "Use Normalized Data" unchecked and vice versa.
When compressing the Source
dataset, the data is encoded as BC6HS (the signed representation).
Otherwise, for normalized data the BC6HU (the unsigned representation) is used.
While the unsigned BC6H format allows for an additional bit in the mantissa, it also requires normalization if the data contains negative values and thus requires denormalization in the shader after decompression. For this purpose the former extrema of the dataset are saved seperately as "peaks".
The encoder tool can generate rough error estimates of the grid based on the distance between each original and compressed vector or based on the absolute difference of each component.
To do this, the Source
and Decoded
datasets need to be populated.
This can be done by either decompressing the encoded representation first or by loading a dataset on disk directly into the Source
and Decoded
datasets.
Dependencies are listed in vcpkg.json
and are managed automatically via vcpkg.
- Clone the repository
- Run
bootstrap.[sh|bat]
- The binaries are then available under the
./build
folder.