Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] I need help! => Topic started by: davetwo on 2020-06-16, 08:25:10

Title: How to get material ID mask?
Post by: davetwo on 2020-06-16, 08:25:10
I have a decal applied to an object. And assumed I could use a material ID to make a mask for tweaking in Photoshop later - but I can't seem to get it to work. The mask just stays black.

I'm giving the material a material ID number in the advanced tab of the material editor. Then ticking Material ID and adding the same number in Corona's multi-pass dilogue. (Screengrab attachd for ref). What am i doing wrong here?

PS. I do it with Object IDs all the time.

Corona 5, hotfix 2 for C4D
Title: Re: How to get material ID mask?
Post by: davetwo on 2020-06-17, 09:05:46
Mmm - is there a bug?
Or is there a malfunction between my ears?
Title: Re: How to get material ID mask?
Post by: lollolo on 2020-06-17, 13:27:06
It looks like a bug. Material stacking seems to be a problem. It doesn't work for me too.

C4D R20
6.0 daily Jun 11
Title: Re: How to get material ID mask?
Post by: burnin on 2020-06-17, 13:47:55
Just from top of my head... I don't think this works at all as you would like, since decal is just a texture used by material/shader.

A bypass//
So to create yourself a solo decal pass for masking in post, disable all scene lighting and just apply light material to decal (or any matter you want to have mask made for) then render it out.
Could also make a Take, if you're not sure about the camera position and mess as little as possible in the future.
Title: Re: How to get material ID mask?
Post by: lollolo on 2020-06-17, 13:57:48
Just from top of my head... I don't think this works at all as you would like, since decal is just a texture used by material/shader.

A bypass//
So to create yourself a solo decal pass for masking in post, disable all scene lighting and just apply light material to decal (or any matter you want to have mask made for) then render it out.
Could also make a Take, if you're not sure about the camera position and mess as little as possible in the future.

I didn't think about that. But it sounds logical what you explained. Nevertheless it could be a feature request :)
Title: Re: How to get material ID mask?
Post by: davetwo on 2020-06-17, 14:40:16
Thanks for the replies.

I'd already made a fix using a black and white luminosity texture in c4Ds Physical render similar to what you suggested Burnin (its quicker to render and has better anti-alising than doing it in Corona).

Shame it doesnt work properly in Coronas Material ID pass though.