Graphics Programs Reference
In-Depth Information
Generating mattes using the ID Mask
node
There will be many instances during CG compositing where a few specific meshes in
the image would require a mask pass. This provides control to modify specific pixels.
To obtain these mattes, the ID Mask node can be used along with the information
stored in
Object Index
or
Material Index
passes.
When given a value for the index, the ID Mask node creates a mask for the meshes
that have the same value assigned as their
Pass Index
value, as shown in the fol-
lowing screenshot. All these
Pass Index
values of meshes can be obtained using the
Object Index pass. The Object or Material Index pass has to be connected to the
ID
value
socket of the
ID Mask
node, for the node to pick the
Index
values. The gener-
ated mask information can be used as an input for the
Fac
sockets available to many
Blender nodes to affect only the required mesh.
In the following screenshot, assigning
Pass Index
to one of the three cubes and en-
abling the
Object Index
pass is explained. When the Object Index pass from this ex-
ample is plugged into the
ID value
socket of the
ID Mask
node and a value of
2
is
given as the index value to the
ID Mask
node, it outputs the mask of the blue cube.
The following screenshot shows how the blue cube mask is created using the
ID
Mask
node, using the Object Index pass: