Amit Khanna with a quick post for a tip on Creating a Combined Matte Pass in Mental Ray Maya Using writeToColorBuffer. There are times you would want to create a combined matte pass for shaders applied to multiple objects however the typical Mental Ray writeToColorBuffer Node only takes a single shader as input. Check out the post for Creating a Maya Mental Ray Combined Matte Pass Using writeToColorBuffer here.

Amit Khanna writes: Here’s a way to output single matte pass for multiple objects/shaders using writeToColorBuffer node in Mental Ray. This is handy in situations when you want a combined matte pass for various shaders applied to multiple objects. For e.g: say you have a room where roof comprises of various elements like main roof, fan lights, false ceiling boards etc. Now to separate the complete roof in composite you would want a single matte pass but writeToColorBuffer node takes only single shader as an input.