HDR Formats for glTF Pre-Filtered Environment Maps

Generating pre-filtered environment maps for glTF physically based rendering (PBR) requires balancing high dynamic range fidelity with efficient runtime GPU performance. This article outlines the best HDR formats suited for authoring, pre-filtering, and deploying image-based lighting (IBL) in glTF pipelines, focusing on OpenEXR, Radiance HDR, and GPU-ready container formats like KTX 2.0.

Source Formats for Pre-Filtering

Before packing lighting data for glTF delivery, environment assets must be pre-filtered into diffuse irradiance and specular reflection maps (typically roughness mip chains). Two primary formats dominate this generation phase:

  • OpenEXR (.exr): The industry standard for source map processing. It supports 16-bit half-float and 32-bit float precision per channel. Half-float OpenEXR is best suited for pre-filtering because it prevents color banding and precision loss in bright light sources (such as the sun) while maintaining reasonable file sizes. It also avoids artifacts commonly introduced by shared-exponent formats during mipmap downsampling.
  • Radiance HDR (.hdr): A legacy, widely supported format utilizing an RGBE (8 bits per channel plus an 8-bit shared exponent) layout. While Radiance HDR files are universally accepted by pre-filtering tools like Filament's cmgen or glTF-IBL-Sampler, RGBE encoding can produce visible stepping in extreme dynamic ranges and cannot be natively ingested by GPUs without CPU-side decoding.

Runtime Target Formats for glTF

glTF assets do not typically embed raw .exr or .hdr files due to their massive memory footprints and lack of native GPU compression. Instead, the pre-filtered output is converted into runtime formats:

  • KTX 2.0 (.ktx2) with BC6H / ASTC HDR: This is the most optimal format for glTF runtime transmission, supported via the KHR_texture_basisu extension. BC6H (for desktop) and ASTC HDR (for mobile) are native GPU block-compression formats designed specifically for HDR data. They dramatically reduce VRAM utilization, eliminate runtime texture decompression overhead, and preserve high-contrast specular highlights.
  • RGBM / RGBD Encoded PNG or WebP: For environments targeting WebGL implementations without guaranteed float texture or hardware compression support, pre-filtered results can be packed into standard 8-bit channels using RGBM (RGB multiplied by a range multiplier in the alpha channel). While this sacrifices dynamic range accuracy and can introduce boundary artifacts, it serves as a lightweight, broad-compatibility fallback.

For optimal quality and performance, author and pre-filter environment lighting using 16-bit float OpenEXR (.exr), then compress the resulting filtered cubemaps or octahedral maps into KTX 2.0 (.ktx2) utilizing BC6H or ASTC HDR compression for deployment within the glTF ecosystem.