© Square Enix © Goodbye Kansas


Table of Contents

This page gives information on the Cryptomatte Render Element.


Overview


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 Multi Mattes. 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.

With V-Ray 5.10.20, the Cryptomatte Render Element works with the Progressive Image Sampler type as well.



Download Example File



Parameters


Name – 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 matte IDs are generated.

Node Name – Creates matte IDs based on the names of the Geometry nodes.
Material Name – Creates matte IDs based on the names of the materials assigned to the rendered geometry.
Node Name Hierarchy – Creates matte IDs based on the names of the Geometry nodes while taking the Sub-Network node hierarchy into account.
Per Attribute Value – Creates matte IDs based on a primitive string attribute placed on packed geometry types.
Proxy Sub-Object – Creates matte IDs for each individual object within a .vrmesh or .abc file, provided that the rendered file contains more than one object. Only use this option to generate masks for V-Ray Proxy objects – regular geometry is not included in this Cryptomatte layer.
Material Path – Creates matte IDs based on the material's name and its material path (location), e.g. /matlibrary1/vraymtl ; /matlibrary2/vraymtl. 

Attribute Name – Specified the name of the primitive string attribute used by the Cryptomatte element when in Per Attribute Value mode.

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.

Num. Levels – Determines the number of objects that can be distinguished per pixel. If multiple objects intersect at a single pixel, higher-order elements contains non-zero results. The default value of 6 is normally enough for most cases.

Deep Output – Specifies whether to include this render element in deep images.

Object Path Starts with Slash – Prepends forward slash for object paths if necessary.


When in Per Attribute Value mode, the Cryptomatte element supports Packed Primitives or Packed Alembic Primitives only. Attributes placed on the individual face of a live polygon geometry are not supported. The attribute should be of type string, and placed on the primitives of the rendered packed geometry.

E.g. you could specify path under Attribute Name for a Delayed Load Alembic file to generate matte IDs based on the partitioning of the Alembic file.

When in Proxy Sub-Object mode, instanced V-Ray Proxies share the same internal matte ID, producing the same mask for the same sub-object of every instance. The recommended workflow in this case is to use a separate Cryptomatte render element set in Per Attribute Value mode, with a custom primitive, string attribute placed on the instanced V-Ray Proxies to generate a unique per-instance matte ID, then mask the instances in compositing.


Common Use


After producing a multichannel exr image with the Cryptomatte layer, we can use it in a compositing application, such as Nuke, to color correct the image. This example shows the before and after color correcting.


Before
After


Notes


  • When the Save Deep Data to Separate Files option is enabled from V-Ray Renderer ROP > Images tab > Advanced settings rollout and the output is OpenEXR, you can choose to save the Cryptomatte channels as a separate EXR file. The option is available for both V-Ray CPU and V-Ray GPU rendering. Read more at Images Tab


References