mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-11-04 04:26:18 +00:00
Page:
Using Basis Universal to decompress any supported GPU texture format
Pages
.basis File Format and ETC1S Texture Video Specification
.basis Format Forwards and Backwards Compatibility
.basis file format overview
ASTC HDR 6x6 Example Images
ASTC and XUASTC LDR Usage Guide
Compressor Definitions and Classes
DDS Transcoder
Displaying .astc file block statistics using the peek command line option
ETC1S Compression Effort Levels
ETC1S Encoder Speed
Encoding ETC1S and XUASTC LDR Texture Video
GPU Textures as Derived (Compiled) Data
GPU Textures as Universal Latents
Home
How to Deploy ETC1S Texture Content Using Basis Universal
How to Use and Configure the Transcoder
How to benchmark or directly call the UASTC functions without using .basis
JPEG for ASTC
KTX2 File Format Support Technical Details for basisu v2.0
KTX2 File Format Support Technical Details for basisu v2.1
KTX2 File Format Support Technical Details
LICENSE
Legal IP License Information
List of Available Software ASTC Decoders
NOTICE
OpenGL texture format enums table
Pure C API Common Definitions
Pure C API Compression
Pure C API Transcoding
Release Notes
Shader and In Loop Deblocking
Sponsors and Supporters
The Three Generations of GPU Texture Distribution
Transcoder Debugging
Transcoder Internals Analytical Real Time Encoders and Transcoders
Transcoder Internals Analytical Real Time Encoders
Transcoder Module Definitions and Classes
Transcoder Texture Format Support for ETC1S and UASTC LDR 4x4
UASTC HDR 4x4 Texture Specification
UASTC HDR 6x6 Intermediate File Format (Basis GPU Photo 6x6)
UASTC HDR 6x6 Support Notes
UASTC HDR Examples
UASTC LDR 4x4 Implementation Details
UASTC LDR 4x4 Texture Specification
Using Basis Universal to decompress any supported GPU texture format
Very early HDR 6x6 examples
XUASTC LDR Arithmetic Profile
XUASTC LDR Endpoint Conversion for DPCM Prediction
XUASTC LDR Range Coding
XUASTC LDR Specification v1.0
XUASTC LDR Weight Grid DCT
XUASTC LDR log_astc_block Structure
XUASTC LDR
XUBC7 File Format
XUBC7 Low Level Format
XUBC7 Usage Guide
basisu.exe Command Line Tool Options
No results
35
Using Basis Universal to decompress any supported GPU texture format
Rich Geldreich edited this page 2026-02-11 22:03:58 -05:00
Table of contents
The Basis Universal encoder/transcoder libraries contain easy to use functions to unpack the following standard compressed GPU texture formats:
Full support:
- ASTC - Full specification, any block size, LDR/HDR, all standard ASTC decode profiles (linear vs. sRGB etc.), 9E5 support, logical and physical block packing and unpacking, CEM decoding, BISE quant/dequant, optimized partition pattern subset index calculation, faster XUASTC LDR-only block decoding, fuzzed, two full low-level decoders (for correctness checking): See the stand-alone header library
transcoder/basisu_astc_helpers.horencoder/3rdparty/android_astc_decomp.h. Fuzz compared vs. ARM's decoder in astcenc. - BC7 - Fully specification, in transcoder .cpp module, see
transcoder/basisu_transcoder_internal.h, low-level functionbasist::bc7u::unpack_bc7(). - BC6H - Full specification (signed or unsigned variant), in encoder library.
- BC1-5 - Full format
- ETC1 - Full format
- ETC2 EAC R11/RG11 - Only unpacks to 8-bit/channel
- PVRTC1 4bpp RGB/RGBA - Decompression has been verified against PVRTexTool's output for correctness.
- ATC RGB/RGBA
Limited support (just what we encode to):
- ETC2 RGB/RGBA8 - Only supports ETC1 for color data (no planar, T/H modes). EAC alpha data is fully supported
- PVRTC2 - Limited support: Just the non-interpolated mode our transcoders use.
- FXT1 - Limited support: just the specific BC1-like mode we use
Before you can unpack textures, be sure to call basisu_encoder_init() once at startup.
To unpack individual 4x4 (or 8x4 for FXT1) texel blocks to raw RGBA pixels, use one of these functions declared in encoder/basisu_gpu_texture.h:
bool unpack_block(texture_format fmt, const void *pBlock, color_rgba *pPixels, bool astc_srgb);
bool unpack_block_hdr(texture_format fmt, const void* pBlock, vec4F* pPixels);
This doesn't work on PVRTC1 textures, because the decoder needs access to the surrounding blocks. Alternately, you can create a basisu::gpu_image object, then call gpu_image::unpack() or gpu_image::unpack_hdr(). This works on any supported format, including PVRTC1.