Multimattes with material ID and layered shaders

I’m finding that multimatte render elements do not take into account the material ID of shaders inserted inside a layered shader. In other words, I can’t output a multimatte based on the material id’s of shaders that are connected into a layered shader, and that layered shader is assigned to the geometry. Am I doing something wrong, or is that a normal occurence? The multimatte simply comes out black whether I set multimatte ID or material ID into the sub-level shaders.

Thank you for answering.

Thanks for the feedback.
We managed to reproduce the issue and we’ll log it into our system.
We’ll update you as soon as we have some progress on that matter.

Meanwhile you can use MaterialSelect render element - it work fine even with Layered Sub-Materials.

This issue has been discussed also here:
http://forums.chaosgroup.com/showthread.php?70281-MultiMatte-Materal-ID-pass-through-VrayBlendMat

MultiMattes cannot be generated from mixed materials due to a technical limitation only Material IDs could be extracted but it seems that they do not work with LayeredShader.
This will be also reported into our system and you can use VrayBlendMtl instead LayeredShader until it is fixed.

To be more specific, I am actually using a VrayBlend Material. Not a Layered Shader. My top shader node is a VrayMtl2Sided, with one side being a VrayBlendMtl. So in theory, multimatte ID integer element from the VRaymtl INSIDE the VRayBlendMtl should pass through in order to be able to create a multimatte. If every material has a unique integer multimatte ID, it would be possible to pass through a table of Multimatte ID’s for a specific buffer.

You say multimatte integer ID cannot be extracted at the moment, but that the material select element should work? I’m not sure what to set in my shader. Thank you for further explanation. I have never used material select.

The setup of the shader will not change at all.
Material Select element extract the contribution of a specific shader. You have to just plug the shader into the Materials slot of the Material Select render element and that’s it.

The other approach I mentioned is to use Material_ID render element - it works similarly to Multimatte element, it even uses the same attribute but instead of integer value you have to specify color value.


Thank you. I will try this as needed. At least I learned to use material select element.