Color masks are special images used to assign certain areas of a material their own independent "channels" for aspects like color, texture, mappings, etc. They are used for the PBS_ColorMaskSpecular and PBS_ColorMaskMetallic materials.
Color maps use channel packing to map four different channels to distinct colors. They map the red, green, blue, and alpha color channels of the image to channels 0 to 3 on the material, respectively.
These channels are able to mix together, so a pixel with 100% red and 100% green will be affected by both channel 0 and 1 simultaneously. Channels are not normalized, so a pixel that is ever so slightly red yet 0 in all other channels will be very close to black, as black is the default color for a zero'd out pixel.
It is important to note that the alpha channel maps the same as every other channel, so if one does not want the alpha-mapped channel to affect the other channels, they must set the alpha to 0 while preserving the underlying pixel color. Photo editors have the tendency to "flatten" completely transparent pixels to black, which can get in the way of this. Some ways to prevent this in common image editors include:
- GIMP: Make sure "Save color values from transparent pixels" is checked when exporting as PNG.