Texture Composition / Merging (metalic/roughness/ao/normal)

Is there a way to easily take 3 or 4 grayscale images and merge them into a single image? I’m not sure why this isn’t common but currently I’m using Bitmap2Material3+ with a diffuse texture to generate additional Metallic/Roughness/Normal & Ambient Occlusion maps.

I understand the normal map needs to utilize all 3 color channels for accuracy but why can’t the Metallic/Roughness/& AO maps be merged into a single RGB texture? They are all grayscale images that could be represented by one of the 3 channels (R,G,B). Wouldn’t that save a lot of time and space in the engine?

Much Appreciated,

  • Jeff

UE4 supports packed channels, you can import your grayscales already packed into rgb. :slight_smile:

Compression does not like channel packing. BC1 compression treats rgb as single color. This is good when channels are coherent but when you store independent data to each channel compression will cause channel cross bleed. Also remember that BC1 stores endpoints channels with different bit depths. r and b gets only 5bits and green get 6bit.
It might also cause problems if some properties use sRGB and others do not. Usually you get better results with smaller memory footprint if you use smaller size(half * half size = quarter memory) for masks but separate textures using single channel alpha compression(3 times the memory). Then you get lot cleaner textures with smaller memory footprint.(75%)
You also gain freedom to choose texture dimensions per mask and you can skip each mask separately if it’s constant value or does not make sense.

So I guess I’m not understanding what you all are suggesting. If I have 3 grayscale images for every texture in the game, what is the best option here? What do other developers do?

Three separate textures using _ALPHA texture compression is best quality. This use BC4 texture compression which is very high quality for single channel textures. This is exactly same that default option always use for alpha channel. If memory is very big concern I would first try to downscale textures instead of packing them together.

PS. Channel cross bleed is very ugly and big problem and it’s biggest reason why normal maps are compressed using BC5 instead of BC1 even though BC5 is double the size and need more expensive unpack shader code.