VRayMtlID

How do you use it and what are the benefits of other masking methods? How do you assign the color?

Seems like a less sophisticated version of cryptomatte. The colours are assigned based on the id number somewhat arbitrarily. Only way I see this useful is in 32bit exr compositing workflow, but with no aliasing this feels like a last resort masking.

It does antialias if required, but with cryptomatte implemented I can’t see any benefit whatsoever in using anything else - apart from maybe that cryptomatte is atm only bucket, which is less than ideal but hopefully addressable.
Although I guess, thinking about it, it’d be a workaround to render a rapid noisy version of the render purely to output the cryptomatte. Cryptomatte is cool :slight_smile:

Anyway Bobby, to use it if you have, say, 3 materials on 3 faces of a cube and you just need to set each to it’s own channel id, found to the left of the ā€˜show map in viewport’ button :slight_smile:
Set Vraymtid to colour(AA) for AA.

Channel ID… where do you find this? I tried Material ID and Object ID, but I didn’t get anything.

It’s the same button…just my descriptor…it’s a material ID channel :slight_smile:
So you have 3 materials and you have each one set to e.g. mat id 1, 2 and 3..et voila!

Yeah, it isn’t working for me. I’ll try it again on my next project.

That’s odd - I’ll upload a scene when I get back.:slight_smile:
Just to be a little clearer the mat id is set at the parent level of the shader - nothing to do with bitmaps or other stuff.
Then as long as you have the vray mtlid they should all show as a render element.

Here is a simple scene showing application :slight_smile:

But, everything has a material id of default 1, no? I’ll look at your scene, thank you.

OK, figured it out. GPU doesn’t support it, which is why it doesn’t work for me. I use PSD Manager to mask everything by layer, but it doesn’t work with GPU. I need an easy way to mask things, so I thought I would try VRayMtlID. I’ll use VRayObjectID, which works.

Don’t.
Rather use Multimattes in objectID mode.
That will give you anti-aliased masks, as opposed to integer ones which come without (for GPU at least. With CPU you’d get AA in those as well.).
It will also save you from having to select AAsed color pixels against arbitrary BGs (ie. black would be good, but then when they overlap the colors may mix in an unfriendly way.), as it will contain one ID per channel (one in R, one in G, one in B, and so on for each MM RE you’ll add.).
It’s a bit more laborious to set up manually, but it’s a tried and tested method, one that worked exceedingly well for many years in the heaviest of productions.
It’s also fairly easy to switch between Material ID and Object IDs, should the need arise.

I’m trying to see if Cryptomatte is a good alternative. From what I’m seeing on my machine and what I read here, Cryptomatte is not antialiased. That eliminates it as a viable matte solution from my perspective. I’ve tried the cryptomatte render element with ā€˜Filtering’ on and off and there is no difference. What am I missing that makes Cryptomatte a useful matte?

The rendering of it at twice the resolution, selection with that, and then scaling down to size to antialias.
In a proper compositing software, like Nuke or Fusion.

The above is the usual approach for non-filtered elements (pPos, Z, renderID, etc.) : make a dedicated pass (i.e. max scene with overrides, lights off, etc.), render it quickly at twice (or more!) the resolution, and use the elements in a compositing package, so the selections gets at the least bilinearly filtered via rescaling.
Anything that falls short, is then handled by the crafty compers, usually very skilled in edges’ management.

Most excellent advice and workflow tips. I appreciate this!

Reporting back in:

That works extremely well Lele. Thanks again for lending your technique.

I’m curious Lele - why would you need to render cryptomattes larger in order to antialias them? They are already perfect masks as far as I can see…I thought that was the whole point of using them, because they were mathematically
generated and can see more values and thus create a more faithful mask than rgb can.

I was unclear in my post, sorry (evening after a long week, i truly didn’t see ā€œcryptomattesā€ in the post i was answering to.).
Not cryptomattes specifically, i was referring generally to non-filtered passes.

For CM, all one needs is a proper reader on the compositing side (i.e. the VFB2, Nuke, Fusion).
Trying to use a cryptomatte as if it was a color mask will very likely fail, or produce wrong/inconsistent results (as CM also stores coverage, which is invisible.).
I should have mentioned trying to pick from inside the VFB2’s masking to verify AA quality.

As for ā€œperfectā€ masks, not quite.
Multimattes have the flexibility to work with the most cases (f.e. mask propagation through refractions), CM doesn’t, but it’s very good to isolate geo and shaders when directly viewed, also via metadata (i.e. names).
And it’s also setup-free, essentially.

Hehe ok, I thought that may be the case, then typically (especially early morning) started to doubt my own knowledge :stuck_out_tongue:

I agree with the other points of course, just personally I’d rather have one CM and then generate specific other matte fixes for e.g. glass.
Options…we love 'em :slight_smile:

Oh i agree.
In a production with some really clever blokes, a long while ago now, they came up with a prot-version of a masking system, not too dissimilar from CM (for the metadata part. it had no coverage.).
*Plus* the usual metric ton of multimattes.

Options are the salt of life. :wink:

I’m by far not very experienced with Cryptomattes at this point but was intrigued by them when I say the latest ā€œWhat’s Newā€ with the update. I started playing with them and found that they are not antialiased at all and even when you enable ā€œFilterā€ for them, they still have sharply defined pixel edges. Maybe I’m doing something wrong.

But, after following Lele’s workflow, they became useful for me. I’ve always known that reducing an image causes more antialiasing. I just never had the ā€œah-haā€ moment and thought to do a Crypotmatte at 2x or 4x and reducing it to achieve that. It seems like an obvious approach looking backwards but simply evaded me. Anyway, that’s my experience. Maybe someone will point out my further lack of experience with Cryptomattes and tell me how to have them antialiased from the start.

Edit: I see my response here is a little out of order as there is more discussion as to how they function. I see now that if you respond to an email that says you were ā€œQuotedā€ that it takes you to a point that is out of order in the entire thread. I’ll watch that in the future.

No problem…it’s easy to miss things or misunderstand…I do all the time.
Let’s blame it on Lele anyway…that’s just easier :stuck_out_tongue:

Anyway, luckily his tip is exact, for that regular matte/zdepth unfiltered workflow, so it is all good information to assimilate :slight_smile: