How to create and use multi-color matte pass?

Hi guys! I’m pretty new to compositing and was wondering if you could point me in the right direction. Usually you can use a RGB or CMY matte pass to for compositing, which is helpful but somewhat limiting when using a lot of objects. Is there a way to create a custom color matte pass for compositing? I would like to create one matte pass with custom multiple colors.

I heard some people use something called a object buffer or material ID pass but I’m not sure if it is the same thing to create a multi-color matte pass. Eventually I would like to export passes from Blender and composite in Nuke. I’m somewhat new to Nuke also so I’m not really sure what it would need to separate the colors there either if more than RGB/CMY were used. If anyone has any ideas, I really appreciate the help!

I´m not sure I understood you: You want to control RGBs for single objects, not for the whole scene?

on nukepedia you can find some gizmos to help you to seperate the colors of an id pass. those multicolored id passes will never get a clean matte for the compositing. there are always problems with edges and how to seperate the different colors.

the object and material ID in blender can also be rendered and if you save it if will be just the numbers of the id you gave the objects. you can map them in a shader to a ramp and use this shader as an override material for the scene and render a colored id pass with this

@NGCHunter2 I want to use a matte pass for the whole scene that could be separated by object based on the color channel.

@pingking23 Thanks for the help! It’s good to know before rendering a lot of multicolored id passes.

ID passes are not antialiased, which causes the edge problems. In Nuke clamp black and white of the pass at the ID value you want to separate and you will get the matte. But you have to soften it a bit to get rid of the hard edge.

There was a quick patch for cryptomatte rendering in cycles, you can search for the cryptomatte thread and look it up. Haven’t tried it myself but cryptomatte solves the aliasing problem and allows for a lot of IDs with relatively small file size. The cryptomatte gizmo for Nuke should be in Nukepedia.