Masks are similar to alpha channels and are convenient to separate and manipulate specific sets of objects and/or materials elements during compositing or color grading. For example, it is possible to separate foreground and background objects using masks in order to perform different colour correction on them, another example is to separate objects which have a specific material assignment. A common practice is to manually assign IDs and colours to specific objects or materials (using the red, green and blue channels) in order to get masks out of the renderer. Another approach is to modify shaders and add custom AOVs to output specific masks. These tedious methods have many drawbacks and are superseded by the Multi-Masks feature presented here.

3Delight for Maya offers a simple method to output multiple masks simultaneously (in a single render with little impact on rendering time).

Using the Multi-Mask feature is a two step process:

  1. creating a 3Delight Mask Set (this is just like a Maya Set node that can be populated with the required objects and/or materials),
  2. selecting it through the Image Layers group of rendering attributes.

3Delight Mask Set can contain:

  • one or more objects (for an object mask)
  • one or more materials (for a material mask)
  • a mix of objects and materials (for an arbitrary mask)

There is no limit to the number of masks that can be created and selected this way. All rendered masks can be saved separately or in the same file (using multi-layers in either EXR or TIFF).

Note that this set-centered approach allows objects or materials sets for masking purposes to be created early in the pipeline (e.g. in the modelling or look-development phase) to be then used in lighting without any prior knowledge of the scene contents (e.g. without knowing which IDs are assigned to which objects or materials).  

For a more in-depth explanation of this feature refer to the Multi-Masks technical memo (PDF).

Creating a 3Delight Mask Set

A mask set can be created using the 3Delight Menu

 

A 3Delight Mask Set is a normal Maya set that can be edited using Maya's Relationship Editor (Windows→Relationship Editors→Sets).  Here is an example showing two such sets for foreground and background objects:

 

Outputting Masks

As soon as a 3Delight Mask Set is created, a corresponding AOV appears in the AOV Selector in the Image Layers section of the Render Settings. In our example above, the AOV Selector would display two additional AOVs:

After clicking the OK button, two layers are added in the list of image layers for output:

 

Result

During rendering, two masks will be rendered as shown here (the output can be considered as an alpha channel): 

Mask: foreground

Mask: background

 

Note that you could also put in a set any material node to achieve a mask for all objects who are assigned to such material(s), following the same procedure:

 

Outputting Masks

Result

Mask: green_material

Mask: red_material

Outlines detection on Multi-Masks

The generality of Multi-Masks allows to solve a frequent hurdle in Anime-style renderings: additional generation of edge contours (or outlines) on object features that are “orthogonal” to assets’ hierarchy or shading setup. Using 3Delight’s sub-sample edge detection feature to generate contours on the corresponding mask layers is very easy, simply select the Multi-Mask Image Layer (AOV), and tag it for outline generation.

(Images and text to be added/revised).

  • No labels