This is a very niche situation for sure, and easy to avoid with a different setup, but would be nice if it worked.
Have a need to switch some objects from matte to normal mode and back many times in a reusable scene with automation. Figured an easy way is to use VraySwitchMtl, and manipulate the switch with a parameter value via script. Turns out when connected to VraySwitchMtl a Matte surface will cast shadows on other matte surfaces, which doesn’t otherwise happen and is undesirable.
Simple example scene: 2 background objects - VrayPlane and cyllinder, hero- red ball.
No matte materials for reference first:
Matte material applied directly to background objects. Everything renders as expected. Shadows cast from hero to Matte object, and Matte to hero only:
Matte material applied via VraySwitchMtl. All possible shadows are rendered ignoring the matte settings:
here’s the background objects’ material set up for clarity:
Any insight into whether this is expected, or bugs, or I have something wrong in my setup would be much appreciated. Thanks!
Interesting. It seems that the “No GI on other Mattes” is not considered when the VRayMtlWrapper is plugged in another shader (happens with VRayBlendMtl and VRay2SidedMtl as well). I’ll ask the devs if this is expected and write back. Otherwise, I found a workaround that may be of use to you. Rather than using a VRaySwitchMtl, set up a Multi/Sub-object node with the two shaders plugged. Apply it to the objects and add a Material modifier with which to control which shader is seen. This way the issue is bypassed.
Thanks!
Hey that’s quite clever, I didn’t consider that!
It actually wouldn’t cover me completely, because in the full picture I already have Multi/Sub-object materials used, so it should technically be several VraySwitchMtl going to a Multi/Sub already. But I can take your idea a little further and have double the number of sub materials, second half being the matte versions, then using an editpoly modifier on top of the stack make the new Mat ID layout, and then just turn that modifier on/off as needed. That could be relatively quick to set up and control via maxscript on all required objects to bypass the issue.