This page gives information on the Cryptomatte Render Element.
Cryptomatte is a method developed by Psyop for efficiently encoding accurate mattes. It uses typically three to five render elements (which are automatically generated) with OpenEXR files, which removes the hassle of creating dozens, or hundreds, of s. Using the Cryptomatte plugin for NUKE or Fusion, mattes can be extracted through directly picking objects or entering object names. Note that single-channel EXR files using DWA compression are supported, in addition to multichannel EXR files.
Compared to theoes not require any additional setup to the scene, like specifying object IDs, material IDs, etc, Cryptomatte d
Currently, the Cryptomatte Render Element requires the Bucket Image Sampler type.
||Render Settings window|| > Render Elements tab > Cryptomatte
The parameters for this render element appear in the Attribute Editor under Extra VRay Attributes.
Enabled – When enabled, the render element appears in the V-Ray frame buffer.
Filename suffix – The text added to the end of the rendered file, when saved as a separate file (e.g. myrender.cryptomatte.exr).
ID type – Specifies how the ID mattes are determined.
Node name – Creates mattes by node names.
Material name – Creates mattes based on the materials in the scene.
Node name with hierarchy – Creates mattes by node names and takes the node hierarchy into account for linked or grouped objects.
V-Ray user attribute – Creates mattes with objects that include the V-Ray User Attribute specified in the User attribute name field.
Asset (reference scene) name – Creates mattes based on Maya References made within the scene. Note: This does not create mattes based on Maya Assets, only file references.
Sub object name – Creates separate mattes for each individual object within a V-Ray Proxy, when the proxy file contains more than one objects. This option works by getting IDs from within the vrayProxy node by creating a mask for each sub-object of the proxy (.abc and .vrmesh). This type produces masks for V-Ray Proxy objects only - regular geometry is not included in this cryptomatte layer.
If a proxy is instanced in Maya, the Sub object name ID type will not distinguish between the instances. It will produce the same mask for the same sub object for all its instances. The recommended workflow in this case is to use a separate Cryptomatte render element with Node name ID type and mask the instances in compositing.
Num levels – Specifies the number of levels for the render element, which determines the number of objects that can be distinguished per pixel. If multiple objects intersect at a single pixel, higher-order elements will contain non-zero results. The default value of 6 is normally enough for most cases.
User attribute name – Specifies a user-defined attribute for creating ID mattes when ID type is set to V-Ray user attribute.
Sub object name mode – Specifies what information about the sub object names goes into the Cryptomatte manifest.
Sub object name only – Only the name of the sub object(s) (e.g. ObjectName) is added to the manifest.
Add short root object name – The dag path and the sub object name(s) (e.g. MeshName.abc/ObjectName) is added to the manifest.
Add full root object name – The proxy file location, the dag path and the sub object name(s) (e.g. D:/Assets/MeshName.abc/ObjectName) are added to the manifest.
Example: User Attribute Name
This example shows how to set the V-Ray user attribute ID type in the Cryptomatte render element options. The V-Ray user attribute ID type is useful to create masks for objects based on a specific user attribute name.
In the example, User Attributes are assigned to the wrenches in the scene. Each wrench has an attribute called wrench with a numeric value that was originally used to create variation for how glossy the reflections would be.
Based on the attribute name, a Cryptomatte layer can be created to mask only the objects that have an attribute with the same name.
This is done by setting the ID Type to V-Ray User Attribute in the Cryptomatte render element. The User attribute name is set to wrench to match the user attribute names on our objects.
The below images show the resulting render and the Cryptomatte preview with masks for only the objects that have the wrench attribute.
After producing a multichannel exr image with the Cryptomatte layer, we can use it in a compositing application, such as Nuke, to mask out and color correct the objects in our image.