Back to tools and samples

Pack AO, roughness and metallic PNGs without mixing up the channels

You have three grayscale maps for one material and need one packed texture. Packing puts a separate value into each red, green and blue slot; it does not blend the maps into a new surface photograph. Start with copies of your source files and check the shader or material documentation that will read the result.

Choose the reader's channel order first

ORM: red = ambient occlusion (AO), green = roughness, blue = metallic. RMA: red = roughness, green = metallic, blue = AO. RMA is the order used here and in Channel Pack Bench, not a promise that every engine recognizes that filename.

For a concrete reference, glTF 2.0 reads roughness from green, metallic from blue and occlusion from red. By contrast, Unity HDRP's mask map uses red for metallic, green for AO, blue for a detail mask and alpha for smoothness. Renaming an ORM file will not produce that mask map.

A four-pixel example you can check by hand

Imagine three 2 × 2, 8-bit masks. These are original teaching values, not a real material or an engine test. Each value is an integer from 0 to 255. At each coordinate, copy the three numbers into the chosen output slots:

Same input values, two output orders. Triples are red, green, blue.
Pixel (x, y)AORoughnessMetallicORM RGBRMA RGB
(0, 0)255320255, 32, 032, 0, 255
(1, 0)19296255192, 96, 25596, 255, 192
(0, 1)6416012864, 160, 128160, 128, 64
(1, 1)024000, 240, 0240, 0, 0

The first ORM pixel looks orange in a color viewer. That does not mean the material is orange: its slots contain three independent measurements. Inspect individual channels or numeric samples. If an input is colored, select the intended channel explicitly; converting its overall brightness to grayscale creates different data.

A free manual route

GIMP is free. Prepare three matching grayscale images or layers. From a grayscale image, choose Colors → Components → Compose, select RGB and assign AO, roughness and metallic to red, green and blue for ORM. For RMA, change the assignments to roughness, metallic and AO. The Compose documentation explains the channel selectors. For an RGB input containing separate masks, Decompose can extract its channels first. Export a new PNG, keeping the originals. Check a known pixel after export; do not assume editor color conversions preserve every stored number.

Three mistakes to catch before import

  • Color handling: glTF's roughness, metallic and AO samples are linear data, unlike its sRGB base color. Follow your target's data-texture import settings; HDRP specifically documents disabling sRGB for its mask map. A packing tool preserving bytes does not configure the engine or correct a previously gamma-converted source.
  • Alpha: PNG stores color independently of alpha. A transparent-looking pixel can still hold RGB data. Do not flatten it against a background when those hidden values matter. Select alpha only if the intended mask is actually there. Ordinary RGB ORM/RMA exports have no alpha channel.
  • Size and alignment: matching dimensions are necessary for direct pixel copying, but the maps must also represent the same surface coordinates. Resolve mismatches deliberately. Nearest-neighbor resizing selects existing samples and may lose detail; smoothing changes values. Keep higher-precision source masters rather than silently reducing them to 8-bit.

Start with one small material. Compressed PNG size is not decoded memory use: a 4096 × 4096 four-byte pixel buffer alone occupies 64 MiB, before other maps or temporary buffers. This is arithmetic, not a device-performance claim. For batches, verify file pairing, chosen input channels, dimensions and output names before exporting everything. Only invert roughness as 255 minus its value when your target's documented convention calls for that conversion.

Free examples and an optional tool

The free output sample on the Channel Pack Bench page contains six finished 128 × 128 RGB PNGs: ORM and RMA versions of three original procedural examples, plus packing records and sample terms. It contains no application and cannot pack your own files.

Optional US$5 app: Channel Pack Bench provides offline batch packing and numerical previews. It accepts static, noninterlaced 8-bit PNGs up to 2048 pixels per side and emits RGB PNGs. It does not make HDRP masks or certify engine compatibility. Development and procedural samples used AI assistance. This guide requires no purchase.