Color masks: Difference between revisions

From Resonite Wiki
m Yosh moved page ColorMaskMaps to Color masks: better title
Marked this version for translation
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
For when these are used, see [[Component:PBS_ColorMaskSpecular]] and [[Component:PBS_ColorMaskMetallic]]
<languages/>


Color maps are defined by 4 channels specifying 4 different colors to blend between. RGBA are the channels; which represent red, green, and blue respectively, with A being alpha or transparency.
<translate>
<!--T:1-->
'''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 [[Component:PBS_ColorMaskSpecular|PBS_ColorMaskSpecular]] and [[Component:PBS_ColorMaskMetallic|PBS_ColorMaskMetallic]] materials.
</translate>


When these channels are not exclusive to each other on a pixel (so there is a mix) the 4 values for RGBA are used to mix the 4 colors associated with that value.
<translate>
<!--T:2-->
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.
</translate>


Despite popular belief, Black is not it's own channel, because it's just Alpha with the absence of RGBA, which creates 100% of the 4th specified color on the material.
<translate>
<!--T:3-->
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.
</translate>


if it's Black and transparent, then black as a color will be used as a default.
<translate>
<!--T:4-->
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:
</translate>
 
* [https://www.gimp.org/ GIMP]: <translate><!--T:5--> Make sure "Save color values from transparent pixels" is checked when exporting as PNG.</translate>
 
== <translate><!--T:6--> See also</translate> ==
 
* [[Channel packing]]

Latest revision as of 05:08, 12 June 2025

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.

See also