Trade-offs of Packed vs. Unpacked Textures

What are the trade-offs of using packed vs unpacked textures? Here are the trade-offs I’ve identified:

  • Packed textures require fewer samplers. This is only important if you’re hitting the max (e.g. 16 allowed by shader model 5).
  • If you are not using all channels of a packed texture, you are wasting GPU memory. Example: you have a packed Roughness, Metallic, and AO, but are not reading the Metallic channel in the material.
  • Packed textures use less disk space than unpacked textures. NOTE: I don’t know if this is true, I’ve seen it mentioned on the internet but haven’t measured it myself. At best it seems like it would reduce any per-texture overhead (like a file header) but that seems like it would be minimal compared to the size of image data.
  • Unpacked textures allow for permutations without exploding the number of textures. Example: you have 10 roughness variants and 5 AO variants, to create packed versions would require 10*5=50 packed variants. In this situation, you’re probably better off using unpacked (at the cost of an additional texture sampler used in the material).

Disclaimer, I don’t know a lot about this topic, so could be wrong on any of them. Please correct me if I’m wrong.

There are only three reasons for channel-packing textures: reducing number and bandwidth of texture fetches, reducing memory usage and staying under sampler state number limitation. Every other consideration that may exist is derived from these reasons.

2 Likes

Reducing used samplers is always important. Sampling from 4 textures will require hitting the memory twice as many times as only sampling from 2 textures.

If you’re using techniques which require textures to be sampled multiple times per fragment (parallax offset mapping, texture bombing) or you are performing layered blending, the number of texture samples will increase a lot if you use unpacked.

The advantage of unpacked are if you need to mix and match, like you mentioned, and compression quality (since packed channels may interfer with one another during compression).