In this chapter, we cover all Matte render elements. Most of them are implemented using the RenderChannelColor plugin, unless stated otherwise.
Overview
A matte render element is an aid for selection masks for the compositing process. The term matte refers to a technique for layering two or more images where parts of each image are masked or blocked from the final composite. When compositing, it can be useful to mask an individual scene object or material in order to include or exclude it in a specific post-production process.
A matte render element consists of values and/or solid colors that facilitate easy selection for masking or control purposes. The colors and values generated for each matte render element depend on the type of render element used:
- Cryptomatte Render Element (VRayCryptomatte) – Uses the Cryptomatte convention by Psypop to encode mattes into multichannel OpenEXRs. Type: RenderChannelCryptomatte
- Material ID Render Element (VRayMtlID) – Colors or values based on Material ID. A wide range of colors is possible. Antialiasing is supported for color. Type: RenderChannelMtlID
- Material Select (VRayMtlSelect) – Renders only the object(s) assigned to a user-specified V-Ray compatible material. The material can be a top-level material or a sub-material of a VRayBlendMtl. Type: MtlSelectRE
- Matte Shadow (VRayMatteShadow) – The matte shadow part of the image.
- Multimatte Render Element (MultiMatteElement) – Colors based on Object ID (G-Buffer ID) or Material ID, with RGB colors only. Antialiasing is supported. Type: RenderChannelMultiMatte
- Multimatte ID Render Element – Isolates objects with specific Multi Matte IDs for compositing purposes. Type: RenderChannelMtlID
- Object ID Render Element (VRayObjectID) – Colors or values based on Object ID (G-Buffer ID). A wide range of colors is possible. Antialiasing is supported for color. Type: RenderChannelNodeID
- Object Select Render Element (VRayObjectSelect) – Renders only the object(s) called out with a specific Object or Material ID. This effect is reversible to create a render element that excludes a particular object or objects according to Object or Material ID. Type: RenderChannelObjectSelect
- Render ID Render Element (VRayRenderID) – Colors based on the node ID or node handle. A wide range of colors is possible. Antialiasing is not supported. Type: RenderChannelRenderID
- Wire Color (VRayWireColor) – The wire color of the object as set in the scene. This can be used to generate masks for the objects based on their wire color. Type: RenderChannelColor
While each matte render element has its uses, the MultiMatte Render Element is the most common choice because of its versatility and the usefulness of the render elements it creates. The Render ID Render Element is the least common; it is used only for specialized purposes.
Examples
Material ID Render Element
Object ID Render Element
Render ID Render Element
MultiMatte Render Element
Material Select Render Element
Matte Shadow Render Element
Wire Color Render Element
Cryptomatte
The Cryptomatte Render Element uses the Cryptomatte convention by Psypop to encode mattes into multichannel OpenEXRs.
The Cryptomatte is a method developed by Psyop for efficiently encoding accurate mattes. It typically uses three to five automatically generated render channels stored in a multichannel OpenEXR file which removes the hassle of creating dozens or hundreds of Multimattes. Using the Cryptomatte plugin for NUKE or Fusion, mattes can be extracted through directly picking objects or entering object names.
Compared to the Multimatte Render Element, Cryptomatte offers the following:
- Does not require a setup with object IDs, etc.
- Only requires a fixed number of additional render elements, typically four.
- Cannot be propagated through reflections or refractions.
Parameters
The Cryptomatte Render Element is accessible through the RenderChannelCryptomatte plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) Displays the name of this render channel. Additional rank layers have an integer suffix appended. The default value is VRayCryptomatte.
- alias – (Int) Internal unique identifier for this channel type.
- id_type – (Int) Defines which criteria is used to represent individual cryptomatte object.
- 0 = Node name
- 1 = Node material name
- 2 = Node name with hierarchy (must start with scene/)
- 3 = Node user attribute
- 4 = Node asset/reference name (must start with asset/)
- 5 = Node layer name (must start with layer/)
- 6 = Sub object name
- 7 = Material path
- user_attribute – (String) The user attribute name if id_type is 3.
- add_root_object_name-- (Int) Controls whether the root object name is added to the sub object name in the manifest when id_type is 6.
- 0 = No root object name
- 1 = Add short name
- 2 = Add full name
- num_level – (Int) The number of Cryptomatte rank layers (the number of distinguishable objects within a pixel).
- id_type_prefix – (String) Optional prefix to find the proper scene_name slot from the VRayPlugin.
- write_metadata – (Int) Controls if metadata is appended to the EXR extra attributes.
- 0 = The plugin does not append any metadata.
- 1 = Writes metadata and manifest.
- object_path_start_slash – (Boolean) Prepends forward slash for object paths (if necessary).
Common Uses
After producing a multichannel exr image with the Cryptomatte layer, you can use it in a compositing application, such as Nuke, to color correct the image. This example shows the before and after color correcting.
Material ID
The Material ID Render Element isolates objects with specific materials by Material ID for compositing purposes.
The Material ID Render Element provides a mask for individual objects and materials that is easy to select in compositing software.
This render element either shows each material (by Material ID) as a solid unshaded color, or stores the Material IDs as integer values within the EXR format or V-Ray Image Format file.
The Color (with AA) method supports antialiasing at the edges of objects where they meet other objects or the background. The Integer (no AA) method, which assigns a Material ID to each pixel in the render element, does not support antialiasing as each pixel can have only a single Material ID assigned to it.
More than one Material ID Render Element can be used if desired, for example if you wish to have both solid-shaded color and integer-based render elements for maximum flexibility during compositing.
Parameters
The Material ID Render Element is accessible through the RenderChannelMtlID plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) The name of the render element containing the denoised image. The default value is MaterialID.
Common Uses
The Material ID Render Element is useful for isolating geometry in a scene so it can be enhanced or adjusted with post-production or compositing software.
Material Select
The Material Select Render Element shows a specific material as white and all other materials as black.
The Material Select Render Element isolates and renders only objects in the scene to which the material selected is applied. All objects in the scene to which the material has been applied render normally with proper lighting, reflections and refractions, and all other objects simply render black.
Similar to the Light Select Render Element, the Material Select Render Element enables isolation of objects with a particular material in the composite.
While you may only have one material at a time specified in a single Material Select element, you may have as many Render Select elements as needed in your scene.
Parameters
- base_mtl – The base material. The alpha result of this material is written to all alpha channels specified in the 'alpha_elements' parameter.
- alpha_elements – A list of alpha render elements.
Common Uses
The Material Select Render Element is useful for isolating geometry in a scene based on the selected material. In the examples shown, the window frame material was selected.
Original Beauty Render
Material Select Render Element of objects with blinds material
Material Select Render Element of objects with sofa material
Matte Shadow
The Matte Shadows Render Element shows areas where light doesn't reach. Compare with the Raw Shadow Render Element, which gives areas of cast shadows. While technically not part of the Beauty render elements, the Matte Shadow Render Element can be used to lighten cast shadows by adding it to the Raw Lighting Render Element. It can also be used to assist in adding 3D elements to a background image or footage in the composite.
Common Use
The Matte Shadows Render Element is useful for changing the appearance of shadowed areas in compositing or image editing software. Below are examples of its use.
Matte Shadow + Raw Lighting
Multimatte
The MultiMatte Render Element creates red, green, and blue selection masks based on an object's Object ID (G-Buffer ID) or Material ID.
With the MultiMatte Render Element, only three colors are possible: red, green, and blue. Compare with other matte render elements, which can include a multitude of colors to represent each material or object in a scene with a different color. With MultiMatte, a single R, G, or B channel can be used directly as a matte, eliminating the step of selecting the color in the compositing software. This ease of use makes MultiMatte a popular choice for compositors.
The MultiMatte Render Element includes antialiasing.
To represent all the objects or materials in a scene with just the available red, green, and blue colors, several MultiMatte Render Elements can be generated for a single rendering, each with different Material ID or Object ID settings.
Parameters
The MultiMatte Render Element is accessible through the RenderChannelMultiMatte plugin.
- enableDeepOutput – (Boolean) Specifies whether to include this render element in deep images. The default value is 1.
- name – (String) Displays the name of this render channel. The default value is MultiMatte.
- red_id – (Int) The object ID that is written as the red channel. Set it to 0 to disable the red channel.
- green_id – (Int) The object ID that is written as the green channel. Set it to 0 to disable the green channel.
- blue_id – (Int) The object ID that is written as the blue channel. Set it to 0 to disable the blue channel.
- use_mtl_id – (Boolean) True to use the material IDs instead of the object IDs
- affect_matte_objects – (Boolean) False to not affect Matte Objects. A matte object is an object that has been assigned a Wrapper Material with the Matte surface option enabled.
- consider_for_aa – (Boolean) True to consider this render element for antialiasing (may slow down rendering).
- exclude_list_red – An exclude list for the red ID.
- exclude_list_red_as_inclusive_set – (Boolean) True to apply MultiMatte only to objects in excludeList_red; false to apply MultiMatte to all objects out of excludeList_red.
- exclude_list_green – An exclude list for the green ID.
- exclude_list_green_as_inclusive_set – (Boolean) True to apply MultiMatte only to objects in excludeList_green; false to apply MultiMatte to all objects out of excludeList_green.
- exclude_list_blue – An exclude list for the blue ID.
- exclude_list_blue_as_inclusive_set – (Boolean) True to apply MultiMatte only to objects in excludeList_blue; false to apply MultiMatte to all objects out of excludeList_blue.
Common Uses
The MultiMatte Render Element is useful for isolating geometry in a scene. While other matte render elements perform similar tasks, MultiMatte is often quicker to use in compositing software because it can be made to include only pure red, green, and blue channels to represent objects in the scene. Compositing software often has a feature for easily selecting the red, green, or blue channels in an image for use as mattes.
MultiMatte ID
The Multi Matte ID Render Element provides a mask for individual objects and/or materials, based on the Multi Matte IDs that have been added as Extra V-Ray Attributes.
The Multi Matte ID Render Element contains no shading information at all, and only contains blocks of color that correspond to each Multi Matte ID. It uses the Multi Matte ID set when the Material ID attribute is added to a material.
A typical usage of this render element, is to use the colors produced in the Multi Matte ID to produce a mask or alpha channel in post production that covers everything with that Multi Matte ID.
Type: RenderChannelMtlID
Parameters
The Multi Matte ID Render Element is accessible through the RenderChannelMtlID plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) The name of the render element containing the denoised image. The default value is MaterialID.
Object ID
The Object ID Render Element isolates individual objects with colors or integer values for compositing purposes.
In some host applications, each object can be assigned an Object ID. This value is also sometimes called the G-Buffer value. Two or more objects in the scene can share the same Object ID.
The Object ID Render Element creates selection masks based on Object ID. This render element either shows each object (by Object ID) in a solid unshaded color, or stores the Object IDs as integer values within the EXR format or V-Ray Image Format file.
The Color (with AA) method supports antialiasing at the edges of objects. The Integer (no AA) method, which assigns an Object ID to each pixel in the render element, does not support antialiasing as each pixel either has an integer assigned to it, or it does not.
More than one Object ID pass can be generated for a single rendering if desired; for example, if you wish to have both solid-shaded color and integer-based render elements for maximum flexibility during compositing.
Parameters
The Object ID Render Element is accessible through the RenderChannelNodeID plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) Displays the name of this render channel. The default value is ObjectID.
Common Uses
The Object ID Render Element is useful for isolating geometry in a scene based on the Object ID. This means that items can be isolated by use of a matte created from the solid colors within the Object ID pass. In the example below the sofa has an Object ID of 1, the dangling light has an Object ID of 4 and the sideboard has an Object ID of 2.
Object Select
The Object Select Render Element stores only the object(s) called out with a specific Object or Material ID.
The Object Select Render Element stores only the objects that have specific Object or Material ID assigned to them. This effect is reversible to create a render element that excludes a particular object or objects according to Object or Material ID. When rendering this element out using Raw mode, it also includes filter and alpha passes separately to help make it easier to use when compositing.
Parameters
The Object Select Render Element is accessible through the RenderChannelObjectSelect plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) Displays the name of this render channel. The default value is ObjectSelect.
- id – (Int) The object/material ID that will be extracted
- ids – (Int) The object/material IDs (more than one) that will be extracted.
- use_mtl_id – (Boolean) Specifies whether to use the material IDs instead of the object IDs.
- affect_matte_objects – (Boolean) Set to False to not affect matte objects.
- consider_for_aa – (Boolean) Set to True to consider this render element for antialiasing (may slow down rendering).
- invert_selection – (Boolean) Set to True to use object/material IDs different from the specified by id.
- denoise – (Boolean) Specifies whether to denoise the channel or not.
- color_mapping – (Boolean) Specifies whether to apply color mapping to the channel or not.
Common uses
The Object Select Render Element allows items to be isolated for easier control at a composite level. In the example, the curtains are color corrected and tinted yellow.
Render ID
The Render ID Render Element renders individual objects with different colors based on their internally assigned node handles.
The Render ID Render Element creates selection masks based on the node handle of each object or the V-Ray assigned render ID. In some host applications, each object is internally assigned a unique node handle when the object is created. When V-Ray is rendering, each object is assigned a render ID. The intended use for the Render ID channel is to quickly create masks, based on the node handles or the render IDs, for various objects in a scene without having to set up a separate MultiMatte render element for them. A wide variation of colors is used so no two objects will have the same color in the render element.
Node handles and render IDs are not the same as the Object ID: The node handle is assigned by the host application (and can only be changed by it internally) and the render ID is assigned by V-Ray during rendering only. Meanwhile, the Object ID is assigned by the user and can be changed at any time. In addition, while several objects can be assigned the same Object ID, each node handle and render ID are unique to a specific scene object. To create a channel that renders object colors based on Object IDs, use the Object ID (VRayObjectID) Render Element.
Node handle numbers do not ever change, even if objects are deleted; a node handle number for a deleted object is simply no longer used.
There is no antialiasing with the Render ID Render Element; where the edge of one object meets another object, the pixel color at that spot is the color from the object that contributes most to the pixel value.
Parameters
The Render ID Render Element is accessible through the RenderChannelRenderID plugin.
- enableDeepOutput - (Boolean) Specifies whether to include this render element in deep images.
- name - (String) Displays the name of this render channel. The default value is RenderID.
Common uses
The Render ID Render Element is useful for isolating geometry in a scene. This means that items can be isolated by use of a matte created from the solid colors within the Render ID pass. Exact RGB values for any object in the scene can be looked up if the XML report is saved.
Render ID Render Element with Use node handle disabled
Render ID Render Element with Use node handle enabled
Wire Color
The Wire Color Render Element renders each object in the scene in its wireframe color.
The Wire Color Render Element stores the wireframe color of the object as set in the scene. The color is flat, with no highlights or shadows. This render element can be used to generate masks for objects for use in compositing.
Wire Color provides a render element similar to Matte Render Elements. Use Wire Color when you wish to separate objects by wireframe color rather than by Object ID or Material ID.
Common Uses
The Wire Color Render Element is commonly used to create a mask for objects in a scene for color correction or color grading. In the example below, a matte was created for the floor and then used to change the color of the floor by using color correction in composite.