Skip to main content

Unreal Engine - Asset Compression Optimization

For best quality vs memory tradeoffs you really need to understand how these texture compressions work.

So start by reading this.

thing that affects textures is how you use them.

Height Map

Good example is height map.

  • If you are using for POM you really want it to be in separate texture to save bandwith.
  • POM takes multiple sample from texture so you don't want to pollute texture caches and waste bandwith for channels that POM isn't using.
  • So height should be packed to single channel compressed non srgb texture.(Alpha/BC4)

Alpha

Nice simple trick to know is that if your texture don't have alpha channel but you read it it's always 1.

this can be used to save memory without any additional cost for materials runtime or setup cost.

Texture / Color Compression

It's also very important to know that default DXT1(default for rgb) compression can't be used for data that is not dependent.

Also r,g and b does not use same amounts of bits.(5,6,5).

AO, roughness and metallic does not depend on each other so you shouldn't put them to same texture color channels.

RGB and A is separately compressed on PC but not on mobile so this also can affect how you choose things.

Texture size is also big deal.

Metallic and AO can be usually use lot smaller texture size than color or roughness.

So those shouldn't be on same texture because this make them size to be locked to each other.

Optimization Example

What we use is this:

  1. For albedo + roughness: Default rgba.(1byte per texel).
    1. For fully rough objects check compress without alpha to save 50%.(½byte per texel)
  2. Normal map: Normalmap compression.(1byte per texel)

Optionals:

  1. Metallic: alpha/BC4.(½byte per texel).
    1. Size is quarter or even smaller.
    2. So actual extra is about 1/8 byte per albedo map texel.
  2. Emissive: Default rgb.(½byte per texel).
    1. Size is quarter or even smaller.
    2. So actual extra is about 1/8 byte per albedo map texel.
  3. Opacity alpha/BC4.(½byte per texel).
    1. Size is quarter.
    2. So actual extra is about 1/8 byte per albedo map texel.
  4. Height: alpha/BC4.(½byte per texel).
    1. Size is quarter or even smaller.
    2. So actual extra is about 1/8 byte per albedo map texel.

This way you get best control for quality vs memory and minimum amount of compression artefacts.