Mask System
This shader provides a global masking system that can be used at various points in the shader.
The mask system has mask writers, mask slots and mask readers.
Masks are values in the range [0;1].
Mask Slots
Mask slots 'hold' the value of the mask. They're the indirection layer between writers and readers. Multiple writers can write into a mask with different blend modes. Multiple readers can read from a mask.
Mask Writer
Mask writers create the mask value and then write it into some kind of mask slot with a selected blend mode.
Multiple blend modes are available:
- Add - this will add the mask writer value to the current value of the mask in the selected mask slot, limiting the result in [0;1].
- Multiply - this will multiply the mask slot value with the mask writer value, effectively masking the existing mask value with the incoming mask value.
Mask Reader
A mask reader will take the value of the mask in a slot and use it to mask some feature of the shader.
The masking is done by taking the mask value and multiplying the shader feature by it.
Mask Options
Name
You rename the mask to have whatever name you'd like it to have. This name will show up in mask reader and writer dropdowns.
Invert
The invert checkbox will flip or invert the mask after all writers have written to it, before any reads happen.
Preview
Every mask slot can be previewed using the 'eye' button on the right of its mask settings dropdown in the masks tab. To exit the preview mode, click the eye again.