File masking
 
 
 

File masking uses a texture or image file to specify which areas of the Stencil texture are transparent. Where the Mask file is white, the Image file is visible on the surface. Where the Mask file is black, the shader color is visible on the surface. Where the Mask file is grey, both the Image file and the shader color are partially visible.

If the Image file has four channels (RGBA), then you can use the same file for both the Image file and the Mask file. The RGB information is used for the image portion of the stencil and the A (alpha) is used for the mask portion of the stencil. If, however, the Image file has only three channels (RGB), then you must create a separate Mask file.

You can create a Mask file by converting the Image file to black and white using a paint program. Although you can use a color image file as a Mask (for example, you could use the same file for both the Image and Mask), the level of transparency of the mask will vary through the range of colors.