Image Format Selection for Game Development - Texture Compression and Rendering Performance
Why Game Development Requires Different Image Formats
Image formats for game development have fundamentally different requirements from web or desktop applications. While web prioritizes file size minimization and browser compatibility, games prioritize GPU rendering performance and VRAM (video memory) consumption.
Special requirements for game images:
- GPU-native compression: JPEG and PNG require CPU decoding before GPU transfer, but GPU texture compression formats (BCn, ASTC, ETC2) are directly readable by the GPU, eliminating decode overhead and saving memory bandwidth
- Random access: GPUs need instant access to any pixel in a texture. Formats requiring block-by-block decoding like JPEG are unusable
- Fixed compression ratio: GPU texture compression uses fixed bitrates (e.g., 4bpp, 8bpp), enabling instant memory address calculation for any pixel position
- Mipmap support: Must store mipmap chains - lower resolution versions used for distant objects
In typical game projects, textures comprise 60-80% of total assets. AAA titles handle tens of gigabytes of texture data, making format selection directly impact download size, load times, and rendering performance. Proper format choice can reduce VRAM usage by 50-75% while maintaining visual quality.
GPU Texture Compression Mechanics - The BCn Family (DirectX)
BCn (Block Compression) is the standard GPU texture compression format family for DirectX. All BCn formats compress in 4x4 pixel blocks, with GPU hardware performing real-time decoding.
BCn format variants:
- BC1 (DXT1): RGB + 1-bit alpha. 4bpp. Represents 4x4 blocks using two 16-bit reference colors and 2-bit indices. Lightest but lowest quality - suitable for opaque textures and distant scenery
- BC3 (DXT5): RGB + 8-bit alpha. 8bpp. Adds independent alpha channel compression at 4-bit precision to BC1's RGB. Standard for semi-transparent textures
- BC4: Single channel (grayscale). 4bpp. Optimal for heightmaps, roughness maps, and single-channel data
- BC5: Two channels. 8bpp. Ideal for normal maps - compresses XY components independently at high precision, with Z reconstructed in shader
- BC6H: HDR (half-float) RGB. 8bpp. Used for environment maps, HDR lightmaps, and high dynamic range textures
- BC7: High-quality RGB/RGBA. 8bpp. Successor to BC1/BC3 with 8 modes, selecting optimal mode per block for maximum quality. Modern standard for color textures
BC7 improves PSNR by 2-4dB over BC1 at the same 8bpp, significantly reducing artifacts on gradients and edges. Encoding takes 10-50x longer than BC1, but decoding is performed by GPU hardware at identical runtime cost.
ASTC - The Mobile and Cross-Platform Standard
ASTC (Adaptive Scalable Texture Compression) was developed by ARM and standardized by the Khronos Group. Supported on iOS (A8+), Android (most Adreno/Mali GPUs), and Nintendo Switch, it has become the de facto standard for mobile game development.
ASTC's innovative features:
- Variable block sizes: 14 block sizes from 4x4 to 12x12. Larger blocks yield higher compression (lower bitrate) at reduced quality. Choose optimal balance per use case
- Flexible bitrate: Continuously adjustable from 0.89bpp (12x12 blocks) to 8bpp (4x4 blocks). Unlike BC7's fixed 8bpp, ASTC enables fine-grained quality control
- 1-4 channel support: Handles both LDR (8-bit) and HDR (16-bit float). Covers color, normal maps, and masks with a single format
Recommended block size selection:
- 4x4 (8bpp): UI textures, character faces - maximum quality priority
- 5x5 (5.12bpp): General character textures, props
- 6x6 (3.56bpp): Background textures, terrain - good quality/size balance
- 8x8 (2bpp): Distant scenery, skyboxes, large low-detail areas
- 12x12 (0.89bpp): Extreme size reduction needs, lowest quality but smallest files
Unity's TextureImporter allows ASTC block size specification, while Unreal Engine offers ASTC profiles in Texture Compression Settings. Integrate ARM's official astcenc encoder into build pipelines for high-quality offline encoding.
Container Formats - DDS, KTX2, and Basis Universal
Container format selection for GPU texture data is equally important. Containers manage texture data alongside metadata including mipmap chains, cubemap faces, and array texture layers.
Major container formats:
- DDS (DirectDraw Surface): DirectX/Windows standard. Optimal for BCn compressed data. Lightweight 128-byte header enables fast parsing. DX10 extended header supports BC6H/BC7. Most common in PC game development
- KTX2 (Khronos Texture 2.0): Vulkan/OpenGL standard container. Supports ASTC, ETC2, and BCn, plus Basis Universal supercompression. Ideal for cross-platform development
- Basis Universal (.basis): Transcodable format by Binomial. A single file can be runtime-transcoded to BCn, ASTC, ETC2, or PVRTC. File size is 10-25% larger than native formats, but eliminates per-platform file variants
How Basis Universal works: ETC1S mode compresses images to an ETC1-compatible intermediate representation, transcoding to target GPU format at runtime. UASTC mode uses high-quality ASTC 4x4-compatible intermediate representation for fast transcoding to BC7 or ASTC. For web-based glTF 3D models, KTX2 + Basis Universal is the standard choice, natively supported by Three.js and Babylon.js.
Selection guidelines: PC-only projects use DDS (BC7), mobile-only use KTX2 (ASTC), and cross-platform projects benefit most from KTX2 + Basis Universal.
Platform-Specific Optimal Format Selection
Available texture compression formats vary significantly by target platform. Selecting formats not hardware-supported by the target GPU triggers CPU decoding, severely degrading performance.
Recommended formats by platform:
- PC (Windows/DirectX 12): BC7 (color), BC5 (normal maps), BC6H (HDR), BC4 (grayscale). Supported on all DirectX 11+ GPUs
- PC (Vulkan/OpenGL): BC7 as baseline. ASTC may be supported on Linux/macOS
- PlayStation 5: BC7-based with proprietary GNF container format
- Xbox Series X/S: BC7 + BCPack (Xbox-specific additional compression layer)
- Nintendo Switch: ASTC recommended. BC7 also supported on Tegra X1
- iOS (A8+): ASTC is standard. PVRTC deprecated (ASTC-only recommended from A15)
- Android: ASTC (Adreno 4xx+, Mali-T760+). Fall back to ETC2 for older devices
- Web (WebGL/WebGPU): Basis Universal (KTX2) with runtime transcoding to BC7/ASTC/ETC2 based on detected GPU
Multi-platform best practices: manage source assets uncompressed (PNG/TGA/EXR), converting to optimal formats per platform in build pipelines. Define per-platform settings in Unity's Texture Import Settings or Unreal's Texture Compression Settings. Integrate texconv (DirectX), astcenc (ARM), and basisu (Basis Universal) into CI/CD pipelines.
Texture Atlas and Streaming Architecture Design
Beyond format selection, texture management strategies significantly impact game performance. Texture atlases and streaming are the two primary techniques for reducing draw calls and optimizing VRAM efficiency.
Texture atlas design:
- Core concept: Pack multiple small textures into one large texture. Reduces GPU state changes (texture binds) and enables draw call batching
- Recommended sizes: 2048x2048 or 4096x4096 are standard. Larger atlases consume significant memory even at lowest mip levels
- Padding: Add 2-4 pixel padding between textures to prevent bleeding (adjacent texture colors leaking) during bilinear filtering
- Mipmap considerations: Non-power-of-two textures within atlases cause bleeding during mipmap generation. Use TextureArrays or ensure power-of-two sizing
Texture streaming (Virtual Texturing):
- Purpose: When total game textures exceed VRAM (20-50GB in AAA titles), dynamically load/unload only needed portions
- Mip-tail streaming: Keep low-resolution mip levels (mip tail) permanently in VRAM, streaming high-resolution levels based on camera distance
- Sparse/Virtual Textures: Use DirectX 12 Tiled Resources or Vulkan Sparse Binding to map only portions of huge textures to physical memory
As a practical example, Unreal Engine 5's Virtual Texture Streaming divides 16K textures into 128x128 tiles, streaming only visible tiles to VRAM. This reduces VRAM usage by 40-60% while maintaining visual quality.