Cryptomatte is a render-time image matte generation system for use with image compositing applications. Created by Psyop, Cryptomatte creates multi-colored ID mattes with support for motion blur, transparency, and depth of field, with no additional render time penalty, and write these mattes into EXR files. These mattes, or ID channels as Cryptomatte refers to them, are typically derived from material names, object names, instance IDs and other attributes (not all ID channels are production stable — see this section below). Cryptomatte can be a tremendous time saver, especially for complex scenes, as it allows work is focused on shot design and creation as opposed to technical matte generation for compositing. 


Getting Started with Cryptomatte

Cryptomatte technology is embedded in Octane Render Engine, therefore it is unnecessary to install or download any additional Cryptomatte plugin for Cinema 4 or Octane. However, it may be necessary to download and install Cryptomatte for particular compositing applications, such as Adobe After Effects and Adobe Photoshop. More information on Cryptomatte can be found here.


How Cryptomattes Work

Cryptomattes use an ID-coverage paring technique, where one channel represents an area of the image for a given channel, and the other channel represents the coverage of that channel in the image. The ID channel is one object per pixel. The coverage channel determines how much of the pixel is contributed to by the assigned object. These ID-coverage pairs are then ranked to add support for multiple objects per pixel (the ranking determines layer priority of object 1 to object n, front to back). That is why the Cryptomatte Channels are always in pairs of two. Keep in mind that Cryptomattes are typically 32 bits per pixel, which adds to resource consumption. That said, this is more of an issue for compositing software than it is for Octane.


When loading EXR files that contain cryptomattes into compositing software with a cryptomatte decoder, it is merely a matter of choosing the different matte ID channels needed to compose elements. As there can be many to choose from, compositors have many options available for shot assembly.


Cryptomatte Requirements

Any objects intended to be used with Cryptomattes should have an Octane Object tag associated with it or its parent object (for more on the Octane Object tag, see here). Cryptomattes require that rendered images be saved in the Open EXR(Octane) file format No other format will render cryptomatte information correctly. Cryptomatte information is stored as extra layers of pixels in the rendered EXR file. These channels will need to be extracted from the EXR file for use in the compositing application. The Cryptomatte Bins attribute, shown in the previous illustration, determines how many ID channels per pixel are allocated. Octane defaults to 6, but should you see issues with the particular Cryptomattes, try increasing the value (must be divisible by two), as this equates to numbered EXR layers denoted with two values (00, 01 and 02, in the case of the default value of 6).


Accessing Cryptomatte

Cryptomatte functions have been integrated into the AOVs system, and are available in Render Settings > Octane Renderer > Render AOV Group > Render AOVs turn down, by clicking on the Add Render AOV Auxiliary > Cryptomatte option:



cryptomatte aov settings




The Cryptomatte will appear in the AOV list in this section as shown in the images. The AOVs can be enabled/disabled, renamed, and otherwise edited as needed. As noted in the Render AOVs topic, Cryptomatte nodes will be connected to the Render AOV input pin of the Octane Renderer node. In order for Cryptomattes to be output, the Enable toggle in the Render AOV Group tab must be ON.



cryptomatte parameters




Valid Cryptomatte ID Channels

The following list is comprised of production-stable ID channels, and discusses how the channels are created. In addition, how Cinema 4D cloners are treated are also discussed:


    • Material Node Name — The Material Node Name channel is used to create IDs by assigned materials in the scene. Using the same material on different objects will result in those objects having the same color (ID channel) in the cryptomatte output.
    • MaterialPinName — The channel ID is used to get polygon/material selections in the scene. Selections will be one channel, and null selections (nothing selected) will be in another channel.
    • Object Node Name — The Object Node Name channel is used to create ID Channels based on object names for each object in the scene. For Object Node Name output, the separations are defined by the Layer ID set up in Octane Object tag > Object Layer tab. Object collections can be achieved merely by assuring that objects have the same layer ID. Unique objects will require unique IDs. Cloners will show only the objects attached to Cloner objects as children. The actual clones generated by cloners will ignored with this option and not output as part of the Object Node Name cryptomatte type. The position of the object will be the first location of the Cloner output, unless the cloner is disabled, which will then (typically) place the object at the origin. 
    • Object Node Pin Name — The ID channel is based upon the names of the exiting Object pins in the scene. It is quite common to see most objects placed into the same ID channel, as Object Node Pin Names change, rarely, depending upon the object source.
    • Geometry Node Name — The ID channels are generated based upon the name of the scene geometry. Cloner output will be combined under a single Geometry Node Name
    • Render Layer — The ID channels are generated based upon the Layer ID in the Octane Object tags for objects in the scene. Render Layer IDs are described here.
    • User Instance ID — The ID channels are generated as determined by the Instance ID setting found in the Octane Object tag. If no tag is present, no channel data will be created for that object. 


do not use these ID Channels

The channels listed below are known to be unstable (change without warning) and should be avoided. This can be directly tested by viewing the cryptomattes in the Live Viewer. If a refresh in the Live Viewer results in objects changing ID colors when viewing cryptomattes, they are not suitable for production use, as the contents will change without warning.


    • ObjectNode — The Cryptomatte channel is based on distinct Object nodes. This option cannot generate stable matte IDs.
    • MaterialNode — The Cryptomatte channel is based on distinct material nodes. This option cannot generate stable matte IDs. 
    • ObjectPinName — The Cryptomatte channel is based on the names of the existing Object pins in the scene. This option cannot generate stable matte IDs.
    • Instance — The ID channel is based on instance IDs, derived from name spaces of hierarchical groups of objects, such as an asset that has been created with a cloner (depending upon the cloner settings). This option cannot generate stable matte IDs.


Cloner Output

Cloners are a special case: If using Cloners, each clone, or clone portion, will can potentially receive a unique color, depending upon the Cryptomatte type chosen. If this is not desired, try different cryptomatte types to see if the result is suitable for the desired use.


Additional Parameters

The Parameters turn down contains some tuning attributes for Cryptomatte. It is best to leave these parameters at the default values for reliable results. 

Cryptomatte Channels

The amount of Cryptomatte channels to allocated. This value must be a multiple of two, as the ID channel and coverage channel must be kept together. When a render starts, Octane collects a number of seed samples, which calculate a Cryptomatte channel distribution. These sets of channels characterize the pixel samples' properties.


Seed Factor

This is the number of samples to use for seeding Cryptomatte. This value gets multiplied by the number of channels specified.  This is important, as this value determines the precision of the Crypomatte pixels. For example, if you have several objects potentially occupying the same pixel, and any (or all) of those objects are in motion, you may see artifacts if the channel value is either too low or too high. Low values will result in pitting artifacts at feathered edges, while large values result in artifacts in places with coverage for lots of different IDs.


IMPORTANT

In Render Settings select Format and make sure that you choose EXR(Octane) — EXR or other formats will not work.


Troubleshooting Cryptomattes

Cryptomattes are black

Compositing applications must have Cryptomatte support, either built in or via plugin, otherwise Cryptomattes will appear to be black. Cryptomatte data uses a clever RGB encryption system which requires Cryptomatte data to be decrypted and converted into imagery that can then be used for compositing. The following links offer free Cryptomatte decoding plugins for After Effects and Photoshop.


Cryptomatte colors keep randomly changing

This happens when an unstable channel ID is chosen for Cryptomatte output. Make sure to choose only from the channels noted in the Valid Cryptomatte ID Channels section.