This note describes two methods of rendering mattes for Massive scenes with AIR, as well as an extension of the second method for rendering by layers or groups.
The above archive contains a very simple shader for rendering an “rgb” matte pass in Massive. Since Massive does not allow an object’s base color to be changed on a per-pass basis, this shader provides parameters for directly setting the output red, green, and blue channels.
This shader is about as simple as a surface shader can get:
The objects which appear in each output image can be restricted to members of particular groups by providing a “string subset” parameter with a list of groups in a Display call. Only objects in the listed groups will appear in the display image; other objects will be treated as matte objects for that image.
These capabilities can be utilized to produce an arbitrary set of mattes for different scene elements in a single render invocation.
Example: say one wanted to render a matte for agents and a matte for terrain.
Start by creating two small text files, agents.rib, with
In Massive assign agents.rib as a custom rib archive to each agent. Assign terrain.rib as the custom rib archive for the terrain. Sim and generate the usual set of exported rib files.
The final piece is another small text file defining the matte images for agents and terrain, mattes.rib:
Include mattes.rib as the options rib in the massive render dialog, or pass it on the command line prior to the main scene file:
air mattes.rib render0001.rib
This method can be used to render a matte for any desired grouping of scene elements.
Rendering Separate Output Images by Group
The above technique easily generalizes to separating any output variable by group. For example, to render separate beauty images for agents and terrain, use: