Multimatte bug when using VRayDistanceTex as Mask in VRayBlendMtl

If I have a large object with ID1, and smaller (not visible to camera) 2nd object stuck into a vraydistancetext for the 1st object, then the multimatte ignores any distances and just shows as it as if object is visible and I didnt use any distancetex
Distancetex is used as mask in vrayblendmaterial

the beauty is fine, just the multimatte is wrong!

VRay Next update 3.2, Max 2021.2

This is not supported at this point, I’m afraid. Other render engines seem to display a similar behavior with such gradient maps in conjunction with integer masks. You can create a mask by adding a VRayExtraTex element and directly plugging in the VRayDistaceTex.

so instead of using the distance tex as the mask, I use an edgestex as mask and stick the distancetext inside the edgestex?

No. Since the result in the RGB is correct, there is no need to remove the VRayDistanceTex from the masking slot. You just need to add a VRayExtraTex in which you plug the same texture, so as to get a black and white image of the map’s effect.

OK that works, thanks!

only things now is if I want to get the mask for the black area, I need to subtruct the white area from my multimatte of the black area

Would be good if this can be solved somehow so we dont need the additional render element and post math layers

EDIT: Adding a 2nd ExtraTex and inverting the colors gives you a masks of the other area. Would still prefer multimatte to work though…