Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => [Max] Resolved Feature Requests => Topic started by: julecocq on 2016-05-24, 12:45:55

Title: Automatize Material ID Render Element
Post by: julecocq on 2016-05-24, 12:45:55
Hi guys,

A great feature would be to:

1- Add a ID to all materials present in a scene, in an automatic way, without having to add them manually. And more than 16 IDs...

2- Add all mask ID render element needed to render all masks, without again, having to add them manually in the render element tab.

At work I'm using Maya / Vray, and we have developped a script to do this in 2 clicks.
Maybe there is way to do that already ?

What do you think ?

Thanks guys !
Title: Re: Automatize Material ID Render Element
Post by: Juraj on 2016-05-24, 13:08:24
Does it not work that way already (1) ? Or maybe I understand it wrong, but all you have to do is select MatID pass and it will randomize each element for you.
Title: Re: Automatize Material ID Render Element
Post by: julecocq on 2016-05-24, 13:15:35
oh yeah ? If yes I didn't know it.

edit: But is it rendering/randomizing RGB masks ? no RGB is a no go...


what about point 2 ?
Title: Re: Automatize Material ID Render Element
Post by: Juraj on 2016-05-24, 13:27:38
Hmm, masks, you're right not sure, since I don't use that. I remember DBOX guys asking me something similar last year....

Maru will answer for sure
Title: Re: Automatize Material ID Render Element
Post by: lacilaci on 2016-05-24, 14:47:46
add render element CMasking_ID and in Masking by ID rollout set to Material ID.

What you get is a render pass with random colors per material. Is that what you're asking for?
Title: Re: Automatize Material ID Render Element
Post by: julecocq on 2016-05-24, 15:01:36
well, this is an option... but random colors is not the best.

RGB masks are the best for selection.

So what I ask for, is, a feature which allows to create all RBG masks you need, in a few clicks.

1- Add an ID in all material present in the scene (more than 16)
2- Add all render element needed to render the mask

When u have 100 materials visible in ur render, it's a bit painfull to add 33/34 RGB masks render elements.
Title: Re: Automatize Material ID Render Element
Post by: Frood on 2016-05-24, 22:58:14
1- Add an ID in all material present in the scene (more than 16)

This is just not possible with Max. You cannot break the 15/16 ID barrier even by scripting, it´s not an UI restriction.

The all-material-pass(es) you are looking for would have to be created differently (maybe by creating object clusters and use the AND condition in CMasing_Mask together with Manual selections or GBuffer ID to get more than 15 IDs to distinguish) or somehow Corona internally.

At least a script like this would be no fun to write and it also wouldn´t be able to handle every scene - a frustrating mess :)

Good Luck!

Title: Re: Automatize Material ID Render Element
Post by: julecocq on 2016-05-25, 10:31:17
This is really bad...

When you have DOF or Motion Blur, having RGB masks is the best. I don't understand why such a simple thing is not possible in Max.

You guys at Corona have an idea ?
Title: Re: Automatize Material ID Render Element
Post by: alexyork on 2016-05-25, 12:29:36
It should be possible for someone to script a simple version of this which does the following:

- for each unique material in the scene create a CoronaMask element and include all the objects with that material assigned to them

You can then Render Only Elements and there should be X number of mask elements - a simple b/w mask for each material type.

Now if someone can be bothered to do it... :)
Title: Re: Automatize Material ID Render Element
Post by: Frood on 2016-05-25, 13:08:43
You ignore for example multisub materials (and whatever else might arise). Think of a car (single mesh) having 30 or more materials. So It has to be some AND operation with material IDs - somehow.

IMHO the only proper option which would work in every(?) scene is to render each material in a seperate (render) pass by batch. This could be automated by script yes, but... it´s ugly :)

Good Luck

Title: Re: Automatize Material ID Render Element
Post by: julecocq on 2016-05-25, 13:15:45
There are scripts working for Vray, so we should find a way to do that with corona :)

Good idea Alexyork !

Or what about having a script/feature doing:

1_For all shaders in the scene, select by material
2_Add an object ID to the geo
3_Add all render element needed to render the mask


?
Title: Re: Automatize Material ID Render Element
Post by: Ondra on 2017-03-21, 13:39:41
This seems like very specific request that is not suited for general usage - it is used for very specific workflow and is extremely memory demanding. I am moving this to resolved without implementing, as it is more suitable to do via custom-made script