ID Mask Node¶
This node can be used to access an alpha mask per object or per material.
- Selection of the preciously specified index.
- This post-process function refines the mask. See anti-aliasing.
- The mask is white where the object is and black where it is not. If the object is transparent, the alpha mask represent that with gray values.
In Blender Internal if a transparent object in front of another, the mask will not reflect partial visibility of the object behind.
An index can be specify for any object or material in the scene. The Object Index can be set in Properties Editorand for the Material Index. To be accessible after rendering, Object Index or Material Index render pass has to be enabled.
In this example, the left rear red cube is assigned Pass Index 1, and the right cube Pass Index 2. Where the two cubes intersect, there is going to be noticeable pixelation because they come together at a sharp angle and are different colors. Using the mask from object 1, which is smoothed (antialiased) at the edges, we use a Mix Node set on Multiply to multiply the smoothed edges of the image, thus removing those nasty lines, thus, being smoothed out.