Puzzle Matte - Arnold for Cinema 4D
In this short tutorial, we will cover the process of setting up and rendering Puzzle Matte AOVs. Puzzle Matte AOV can hold per-pixel contribution of objects and materials on separate RGB channels. That means multiple objects and materials (up to 3) can contribute to the same pixel, which helps overcome aliasing-related issues in compositing when the scene uses depth of field or motion blur.
An example scene can be downloaded here.
Object ID
Follow these steps to setup a Puzzle Matte AOV for object IDs.
- Add an Arnold Object Matte tag to each object.
- Set the AOV name. Use the same name for each object that goes to the same AOV. (e.g.
puzzle_matte_01
for Object 1, Object 2 and Object 3,puzzle_matte_02
for Object 4, Object 5 and Object 6, and so on) - Select a separate channel for each object within the same AOV. (e.g.
R
for Object 1,G
for Object 2,B
for Object 3)
Material ID
Follow these steps to setup a Puzzle Matte AOV for material IDs.
- Open your shader graph (Arnold Node Material).
- Add an
aov_write_rgb
shader as the root of your shader graph. - Set the AOV Name in the
aov_write_rgb
shader (for example, "puzzle_matte_01"). - Connect your surface shader to the Passthrough input of the
aov_write_rgb
shader. - Add a
float_to_rgb
shader and connect it to the AOV Input of theaov_write_rgb
shader. This step is needed in order to avoid color conversion when exporting the AOV Input to Arnold. - Set the channel to 1 in the
float_to_rgb
shader where you want your material ID written.
Textures
Puzzle mattes are mainly used in compositing, but they can also be useful in texturing. Since they can hold up to 3 masks, you can use a single puzzle matte to mix multiple color/texture layers together.
- Load the puzzle matte with an
image
shader. - Add the R, G, B outputs to the
image
shader (right click > Add Output). - Connect the R, G, B output to the Mix of the respective layers of a
layer_rgba_shader
. - Optionally you can add a
shuffle
shader to easily switch between the R, G, and B output channels.
Limitations
Currently only camera rays are supported when creating object/material ID masks. Masks are not recorded through reflections and refractions.