Basis Universal Compression in glTF Alpha Maps
Basis Universal compression maintains high visual fidelity across
glTF alpha maps by combining versatile intermediate encoding formats,
targeted channel allocation, and intelligent run-time transcoding to
native GPU textures. By leveraging the KHR_texture_basisu
glTF extension, 3D pipelines can compress textures into compact
distribution sizes while ensuring that high-frequency transparency
cutouts and continuous scalar values (such as roughness and metalness)
remain sharp and artifact-free on any target device.
The Role of the UASTC Format
Basis Universal operates using two primary encoding modes: ETC1S and UASTC. While ETC1S yields smaller file sizes suitable for diffuse color textures, it often introduces visible ringing, banding, or bleeding into the alpha channel because of heavy color palette quantization.
To preserve alpha fidelity, glTF pipelines rely on the UASTC (Universal ASTC) mode. UASTC is an intermediate format closely aligned with modern hardware texture compression formats like ASTC and BC7. Because UASTC treats the fourth channel with dedicated precision rather than downsampling it, it retains the exact gradients and crisp boundaries necessary for visual realism in alpha maps.
Independent Alpha Endpoint Encoding
Standard lossy compression algorithms often evaluate RGBA values collectively, which can lead to color data bleeding into the alpha mask. Basis Universal counters this by decoupling the alpha processing from the RGB channels:
- Dual-Plane Prediction: UASTC utilizes block modes that evaluate RGB data independently from the alpha plane. This prevents luminance or chrominance shifts in the color channels from corrupting the boundary thresholds of the alpha channel.
- Preservation of High-Frequency Boundaries: Alpha maps used for transparency masks, vegetation, or decals require sharp, step-like cutoffs. By isolating alpha endpoints within each \(4 \times 4\) texel block, Basis Universal prevents boundary softening and halos around masked edges.
Optimized Handling of Packed PBR Maps
In glTF assets, alpha channels frequently store non-color scalar data, such as combined Occlusion, Roughness, and Metallic (ORM) maps, or transmission masks. Compressing these requires strict per-channel independence.
Basis Universal allows creators to specify channel weights and error metrics tailored to linear scalar maps. By prioritizing the alpha channel during the rate-distortion optimization phase, the encoder allocates sufficient bit budgets to prevent quantization artifacts like stepped specular highlights or patchy surface roughness.
High-Fidelity Transcoding to Target Hardware
Basis Universal files are never rendered directly by the GPU; they are transcoded on the fly into the graphics hardware's native format (such as ASTC on mobile, BC7 on modern desktop GPUs, or BC3 on older hardware).
Because the UASTC intermediate structure directly maps to target hardware formats without relying on intermediate uncompressed CPU buffers:
- No Intermediate Decoding Artifacts: Transcoders convert block-level data directly to hardware-level blocks via fast, deterministic lookups.
- Native Filtering Support: Because the final target is a hardware-compressed format, the GPU performs bilinear and trilinear filtering directly on the hardware blocks, maintaining continuous alpha gradients without post-process blur.