We are excited to announce the release of Compressonator v3.1! This version contains several new features and optimizations, including new installers for the SDK, CLI and GUI tool, new batch compress support, improvements to Compressonator’s BC6H and ETC2 support, a new glTF model previewer, and more.
New Installers for SDK and Utils
Based on feedback from developers, who requested a simpler way to integrate compression into their pre-process pipelines, we now provide the “C” SDK and Command Line utility as separate installers. The file structure has also been reorganized and simplified for better portability of the tools into different working environments.
SDK
The Compressonator SDK supports BC1-BC7 (DXTC), ETC1, ETC2, ASTC, ATC, ATI1N, ATI2N. All are available in a single library accessed via a single “C” interface header file.
Included in the new SDK are several example applications with source code that demonstrate how easy it is to add texture compression to your own applications using either the “High Level” or “Block Level” APIs.
High-Level API
A simple thread-safe interface can compress, decompress and transcode any image as required:
CMP_ConvertTexture(CMP_Texture* pSourceTexture, CMP_Texture* pDestTexture,...);
For example:
// To use Compressonator's portable "C" interfaces, just include // a single header file and Compresonator.lib into your projects #include "Compressonator.h" ... //========================== // Load Source Texture //========================== CMP_Texture srcTexture; // note that LoadDDSFile function is a utils function to initialize the source CMP_Texture // you can also initialize the source CMP_Texture the same way as initialize destination CMP_Texture if (!LoadDDSFile(pszSourceFile, srcTexture)) { ... } //=================================== // Initialize Compressed Destination //=================================== CMP_Texture destTexture; destTexture.dwSize = sizeof(destTexture); destTexture.dwWidth = srcTexture.dwWidth; destTexture.dwHeight = srcTexture.dwHeight; destTexture.dwPitch = 0; destTexture.format = CMP_FORMAT_BC6H; destTexture.dwDataSize = CMP_CalculateBufferSize(&destTexture); destTexture.pData = (CMP_BYTE*)malloc(destTexture.dwDataSize); //========================== // Set Compression Options //========================== CMP_CompressOptions options = {0}; options.dwSize = sizeof(options); options.fquality = 0.05f; options.dwnumThreads = 8; //========================== // Compress Texture //========================== CMP_ERROR cmp_status; cmp_status = CMP_ConvertTexture(&srcTexture, &destTexture, &options, &CompressionCallback, NULL, NULL); if (cmp_status != CMP_OK) { ... } //========================== // Save Compressed Testure //========================== SaveDDSFile(pszDestFile, destTexture)) free(srcTexture.pData); free(destTexture.pData);
Block-Level API
Processing of 4×4 pixel blocks is also provided for BC7 and BC6H using the following APIs:
CMP_EncodeBC7Block(BC7BlockEncoder* encoder , double in[16][4], CMP_BYTE* out);
and CMP_EncodeBC6HBlock(BC6HBlockEncoder* encoder, CMP_FLOAT in[16][4], CMP_BYTE* out);
The block-level API is particularly interesting since it lets you wrap up block processing any way you like in your tooling. That hopefully therefore makes it a stronger candidate for integration into your asset generation pipeline, including into in any existing parallel processing system you might have.
SDK: BC6H Improvements
BC6H is a lossy blocked-based compression format designed for compressing half floating-point textures, useful for things like HDR lightmaps, and is fully supported by hardware. The quality of images varies slightly when processed with a CPU based encoder and decompressed by the GPU, compared to decompression on the CPU, and especially when generating MIP map levels with progressively lower resolution images. Our latest release compensates for these differences to reduce the relative decompression errors that causes blocking artifacts and luminance changes.
SDK: ETC2 Alpha Channel Support
ETC2 is another lossy blocked-based compression format designed for compressing textures on devices with limited memory and is fully supported by hardware. Two new modes — ETC2_RGBA
and ETC2_RGBA1
— have been added to Compressonator’s ETC2 support to control the degree of transparency of images.
Ruby Image contains alpha channels and processed with ETC2_RGB
ETC2_RGBA results in larger compressed file size compared to ETC2_RGB, but has better control over transparency in the texture.Ruby image processed with ETC2_RGBA
ETC2_RGBA1 file sizes will be comparable to ETC2_RGB, with only partial transparency control where pixels are either fully transparent or fully opaque.Ruby image processed with ETC2_RGBA1
CLI: New Options
Test Analysis Logging Features and File Filters (Windows only)
The CLI will generate an output process_results.txt
when -log
is added to the compression command line options, users can change the default log file using the command -logfile
, the log captures details of the source and destination files along with statistical data on performance and quality.
For example CompressonatorCLI -log -fd BC7 .\images\ruby.png ruby_bc7.dds
generates a process_results.txt
file with the following content:
Multiple processes will append results to this file with a dash line separator. The option is valid only for compressing images and not for 3D models or image transcoding. The new CLI also supports processing image files from a folder, without the need to specify a file name. Using a file filter, specific files types can also be selected for compression as needed.
For example, to process only images with extension bmp
, png
or exr
you’d use CompressonatorCLI -fd BC7 -ff BMP,PNG,EXR .\images .\results
. Notice that BC7 compression is applied to HDR images as an automatic Adaptive Channel Format feature (ACF) that transcodes the image half float channels to byte prior to processing.
CompressonatorCLI -fd BC7 .\images .\results
will process all image files with BC7 compression into a results folder.
CLI and GUI: Additional Features for Mesh Optimization and Compression
In the previous release we introduced mesh compression and mesh optimization support on obj
files as well as mesh optimization support on glTF 2.0 files through our GUI app. In this new release, mesh compression using Google’s Draco library for glTF 2.0 file format has been added to the GUI.
Additionally, CLI options have been added to support all mesh optimization and compression operations on both obj
and glTF 2.0 file formats.
GUI: New Features
Image Viewer
Users can capture viewed images to file using the “Save View as” context menu, or CTRL+C
(displayed image) or ALT+C
(original source image) to save them to the Windows clipboard.
Image view context menu (enabled by right mouse button click)
Image view status bar showing cursors block position
The cursor position in block increments is also displayed, and users can now save any block to file using the “Save Source Block … as” menu, where … is the current cursor location translated to a block position.
This feature is useful in capturing the source texture blocks that were used for generating compressed blocks that exhibit decompressed image artifacts or poor quality. Depending on the source, a 4×4 block image is saved to either BMP or EXR file formats, which can later be used for repeated analysis.
DirectX® 3D Model Image Diff Viewer
This feature allows the user to select a manual override of the automated difference view of two rendered models. The Auto View switches render frames at a predetermined rate after two render cycles of each model view, the Manual View allows the users to manually switch view using the space bar.
3D Model Diff View Panel
Manual View: when the space bar is pressed, rendered views will switch between original and processed views. That enables users to examine the level of detail on each rendered view and easily distinguished defects, especially when the model meshes has been compressed or optimized.
Vulkan® Viewer (alpha preview, Windows only)
Allows viewing glTF 2.0 scenes with textures. Currently the 3D Model Diff and Stats features are disabled with the Vulkan viewer.
Enabling Model Renders with Vulkan
More information
Head over to the Compressonator product page for more information about the tool and its capabilities.
You can also access the GitHub repository and releases directly. Detailed documentation can be found here.
We want to hear from you! New feature suggestions or ideas for improvement are always welcome, please use the Compressonator GitHub to leave your feedback.
Thank you for your ongoing support, and we hope that you find this new release of the Compressonator tool useful in your project workflows.