Announcement

Collapse
No announcement yet.

VrayMtlWrapper with VraySwitchMtl - shadow issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VrayMtlWrapper with VraySwitchMtl - shadow issue

    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:
    Click image for larger version

Name:	switchMat_SwitchfullAlpha.jpg
Views:	162
Size:	73.7 KB
ID:	1177712

    Matte material applied directly to background objects. Everything renders as expected. Shadows cast from hero to Matte object, and Matte to hero only:
    Click image for larger version

Name:	switchMat_JustMatte.jpg
Views:	83
Size:	60.2 KB
ID:	1177713

    Matte material applied via VraySwitchMtl. All possible shadows are rendered ignoring the matte settings:
    Click image for larger version

Name:	switchMat_SwitchMatte.jpg
Views:	87
Size:	75.2 KB
ID:	1177714

    here's the background objects' material set up for clarity:
    Click image for larger version

Name:	switchMat.jpg
Views:	80
Size:	41.0 KB
ID:	1177715

    Any insight into whether this is expected, or bugs, or I have something wrong in my setup would be much appreciated. Thanks!

  • #2
    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.
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      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.

      Comment

      Working...
      X