Page Contents ×

This page provides information about the V-Ray Masks.

 

Overview


The V-Ray Masks are used to refine only selected parts of the rendered image in the New VFB. They can be applied to Color correction layers and also to Folders in the VFB layers tree.

V-Ray Mask can be created using the Add layer button. The same option is available in the right-click context menu of the layer tree under the New layer category. There's also a quick Mask creation button in the Properties area of Folders and Color correction layers.
When one or more masks are applied to a Folder or Color correction layer, a mask icon is placed in front of it in the layer tree to signify its presence. The parameters of each mask are available in their own separate tabs to the Properties of the masked layer or folder.

The masked areas are defined by selection of objects, materials, groups, layers, etc. To specify them respective render elements must be available in the rendered image. Currently, there are three Mask types: Integer Mask, MultiMatte Mask, and Cryptomatte Mask.

 

UI Path:

||V-Ray Frame Buffer|| > Layers Add button
||V-Ray Frame Buffer|| > Layers > New Layer right-click menu option
||V-Ray Frame Buffer|| > Layers > Color Correction properties > Add new mask layer button

Note that you must select a folder or a color correction layer to use masks. Otherwise, the masks are inactive.

 

 

 

Parameters


The following parameters are common for all masks:

Blending – Determines how multiple masks are blended together over a single correction layer:

Overwrite – Sets the current mask as it is, without blending it with the masks before it (standing on its left).
Add – Adds the current mask to the result of all masks before it. This is the default mode.
Subtract – Subtracts the mask from the result of all masks before it.
Multiply – Multiplies the mask with the result of all masks before it.
Divide – Divides the mask by the result of all masks before it.

Element – Specifies the render element from which the mask is read. Only render elements available in the rendered image and compatible with the type of the mask are listed in the drop down.

Opacity – (Mask opacity multiplier) Determines to what degree the selected layer obscures or reveals the layer beneath it. Even if there’s only one mask child, you can modify its opacity. The opacity is multiplied with the mask color.

Show preview when selected - When enabled, shows a preview of the mask if the mask is selected.

Invert mask – When enabled, inverts the mask results.

Multiple masks can be combined, e.g. an Exposure layer with two masks to it. The blending mode parameter to the first mask (the one on the left) is not considered and is always grayed out.

Note that all masks are created with Blending mode set to Add. If there is only one mask child, the blending mode has no effect.

When seeing masks in preview (i.e. the Show preview when selected option is enabled), the name of the layer/folder that contains the mask(s) is in bold in the layers tree.

 Note that the preview cannot be saved.

– Allows you to add a new mask layer.

– Shows all tabs of the currently selected color correction layer.

When a mask is added to a layer, the Show masks' preview option is available in the layer's Parameters tab. This options shows a preview of the masks when selected.

 

 

MultiMatte Mask


The MultiMatte Mask is based on the Multi Matte render element.

Note that this mask may not work on images rendered with older versions of V-Ray.

Use red – When enabled, uses the red channel as a grayscale mask.

Use green – When enabled, uses the green channel as a grayscale mask.

Use blue – When enabled, uses the blue channel as a grayscale mask.

Use intensity – When enabled, uses the pixel intensity as a grayscale mask.

 

Integer Mask


The Integer Mask is used with Render ID, Object ID, Material ID and Multi Matte ID render elements. You can choose which IDs should be in the mask.

+/- Pick – Allows you to add/remove items by picking them from the Render View. When activated and the mouse is inside the Render View, a red square indicates where the value is exactly picked.

Value – Shows the mask ID on hover over the rendered frame. If you click on a selection in the Render View, the current ID is added/removed from the list below, depending on the Pick mode.

New item – A field to type a mask ID manually and then add it to the current selection with the + button.

+ – Adds IDs to the list.

- – Removes IDs from the list.

Each item in the list has a color icon. The color corresponds to the one saved in the respective render element.

Separate items in the list can be changed by double-clicking on them and editing their names.

 

 

Cryptomatte Mask


The Cryptomatte Mask is based on the Cryptomatte render element.

+/- Pick – Allows you to add/remove items by picking them from the Render View. When activated and the mouse is inside the Render View, a red square indicates where the value is exactly picked.

Value – Shows the mask ID on hover over the rendered frame. If you click on a selection in the Render View, the current ID is added to the list below.

New item – A field to type in a mask ID and add it to the current selection with the + button. The text is case insensitive.

+ – Adds IDs to the list.

- – Removes IDs from the list.

Wildcards are allowed in the New item field. The following wildcard characters are supported:

* – matches any number of any characters including none (e.g. "Law*" matches "Law", "Laws", or "Lawyer")
? – matches any single character (e.g. "?at" matches "Cat", "cat", "Bat" or "bat")
[abc] – matches one character given in the bracket (e.b. "[CB]at" matches "Cat" or "Bat")
[a-z] – matches one character from the range given in the bracket (e.g."Letter[0-9]" matches "Letter0", "Letter2")

Each item in the list has a color icon. The color corresponds to the one saved in the respective render element.

Separate items in the list can be changed by double-clicking on them and editing their names.

You can create Exclude items via the -Pick button. This is possible when you have wildcard items and then try to -Pick an item that is not present in the list. For example, we can add all boxes from the scene with a wildcard Box* and then exclude only Box001 with an Exclude item. Exclude items have a minus in their icon so they can be distinguished.

 

 

Notes


  • Currently, there are masks based only on some V-Ray render elements. The different mask types filter the list of all elements and show only the suitable ones.
  • Currently, masks cannot be placed directly on a render element layer. A color correction layer must be placed first on the render element, and then the mask is added on top. For example, a Hue/Saturation layer is applied on the RGB color or a Light Select Render Element layer and then a mask is added on the correction layer so that only the masked area has the correction applied.