Blender Color Mask Node Setup and Breakdown
Simple Node Group to help split and apply color mask textures in Blender. This is general blender info and requires no credits.
- Load this blend file into your asset library
- Append the Material MI_Base_Masked or the Object Demo_Sphere to your current blend file.
- The object has the masked material assigned.
- View the material in the shader editor to see a node_group called "Mask_Splitter".
- Copy and paste this inside whatever material you wish to split out a color mask
- Assign the Color output of your image mask to the Color_Mask input of the node group.
- Using a MixRGB node or Mix node (3.4+) to assign colors according to the mask map as needed.
The dropdown has different blend modes
Fac: This is the mixing factor of the blend. It works on a black-to-white scale from 0.00 to 1.00 by default or the data plugged into the Fac input. You can not use the 0-1 slider if an input is used.
Color1: Is the Base Color or Image Color2: This is the added color or image.
The color output is the result of the factor and the blend mode selected.
This group separates the primary colors used when creating a color mask by most of the industry into their own fac which can be used as you see fit when mixing your nodes.
Black / White / Red / Green / Blue / Cyan / Yellow / Magenta.
Node Breakdown: White = (R x G) x B) Black = (R x G) x B) [Con, Inv] -R)-G)-B) Red = (R-G)-B Green = (G-B)-R Blue = (B-R)-G Cyan = (R-G) x B Yellow = (G-B) x R Magenta = (B-R) x G
Con = Contrast/Brightness Node Inv = Invert Node
I then used a Con node at the end with a Contrast of 10 to ensure I have a clean mask when blending.