The problem with JPEG and PNG
A JPEG is small to download, but on the graphics card it is decompressed and occupies its full size in memory. GPUs have their own compressed texture formats that are smaller in memory and faster to sample [3]. Unfortunately no single format is supported everywhere [3].
The fix: one universal intermediate format
Basis Universal stores the texture once and transcodes it at run time into a format the visitor's GPU understands [1][3]. In glTF this is handled by the KHR_texture_basisu extension, aimed at more efficient transmission and a smaller GPU memory footprint [2]. There are two modes [1]:
- ETC1S: much less GPU memory than JPEG or PNG and often smaller files, at lower quality than UASTC.
- UASTC: higher quality, still with noticeable memory savings.
The trade-off
MDN notes that compressed texture formats look worse than JPEG and are generally only acceptable for colours, not for normals or coordinates [3]. For normal maps it is therefore worth checking whether UASTC is good enough or another format serves better.
When KTX2 pays off
- many or large textures, such as high-resolution wood, fabric or stone;
- scenes that run close to the GPU memory limit on phones;
- variants with many colour textures loaded one after another.
With a few small textures the effort often outweighs the benefit. The GLB files in our example configurators currently use WebP textures (the EXT_texture_webp extension); gltfpack can produce either [4]. The guide CAD to web 3D puts textures in the wider preparation process.