Material ID pass ??

Discussions about FX-Tree and Compositing generally
Post Reply
fabilabo
Posts: 69
Joined: 28 Jan 2010, 13:13

Material ID pass ??

Post by fabilabo » 01 Feb 2012, 11:00

Hi folks,

I get deeper into composition passes (in fusion actually)
I rendered all my buffers, diffuses, reflections, refractions etc and i wanna get a total control by materials.

There is a way to output an material ID pass ? only way i found is to manually create matte pass.
BUT
- if i have 50 materials i have 50 passes...
- passes dont take clusters into it...

How your guys are doing ?
thanks !

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 21 Jul 2010, 00:33
Skype: gustavoboehs

Re: Material ID pass ??

Post by gustavoeb » 01 Feb 2012, 13:06

Not in front of SI right now but I'm pretty sure there is a ObjectID (not sure of a material ID, but probably) RENDER CHANNEL (not pass). It is ok but there are some problems with it:
(1) not anti-aliased
(2) if you have objects with anymated visibility it will re-arrange the colors (ids) on all objects from that frame forward... making it useless...

So that may work for you or may not...

Do you really need 50 mattes? Sounds like your compositing is not going to be pratical at all, cant you group stuff into bigger groups and do some RGB matte passes?
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

Falam

Re: Material ID pass ??

Post by Falam » 02 Apr 2013, 04:15

gustavoeb wrote:Not in front of SI right now but I'm pretty sure there is a ObjectID (not sure of a material ID, but probably) RENDER CHANNEL (not pass). It is ok but there are some problems with it:
(1) not anti-aliased
(2) if you have objects with anymated visibility it will re-arrange the colors (ids) on all objects from that frame forward... making it useless...

So that may work for you or may not...

Do you really need 50 mattes? Sounds like your compositing is not going to be pratical at all, cant you group stuff into bigger groups and do some RGB matte passes?
Can you point me on how to create a material ID pass ? If material ID channels are useless because they are not Anti-Aliasing and there also useless if they have a semi-matted material then a material ID pass seems the best solution except I'm looking and looking on how to create one in Softimage, it most likely involves overrides, what is the order of operations & nodes :)

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Material ID pass ??

Post by FXDude » 03 Apr 2013, 07:29

Look for <<MaterialID Setup>> on http://RRay.de

and more details here http://www.si-community.com/community/v ... f=29&t=342

And please tell us how it went! :)

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Material ID pass ??

Post by FXDude » 03 Apr 2013, 07:38

You can render that pass with no antialiasing (so you can then easily separate each color)
but at very high resolution (still pretty quick to render )
which makes resizing back down (after separation) act like a form of supersampling.

Falam

Re: Material ID pass ??

Post by Falam » 03 Apr 2013, 22:25

Thanks FxDude, I appreciate it :)

Falam

Re: Material ID pass ??

Post by Falam » 05 Apr 2013, 17:16

Code: Select all

SelectObj "sphere.polymsh.cls.Polygon"
SetValue "Sources.Materials.DefaultLib.Material.Phong.diffuse.green", 0
SelectObj "sphere", , True
' ERROR : The data type 'RGB' is not supported by Softimage when rendered with mental ray
' ERROR : 2028-EDIT-SetValue - Invalid argument specified. - [line 116 in c:\users\christoher\desktop\Make MaterialID Framebuffer.vbs]
MakeMaterialIDFramebuffer
I get the above error when I run the script. I placed a cluster on part of the sphere, same error ?

It would be helpful if you can select a color on a texture and it gives that color a unique MaterialID I don't know whether that change can be done ?

Falam

Re: Material ID pass ??

Post by Falam » 15 Apr 2013, 16:15

You can use a 'storeInChannel' to create a channel, but as I started another thread here, what if I don't have clusters, it appears that the workflow requires clusters to work effectively to create a MaterialID ?

If I can't make a material ID based on a color on a texture, is it possible to make a cluster based on a color on a texture then making a material ID from the cluster which was created from the color on the texture, I hope that didn't confuse anyone the last paragraph ? :) I don't know the method some of you use, only from what I read on a few tutorials, maybe what I'm describing is unheard of ?

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Material ID pass ??

Post by FXDude » 16 Apr 2013, 08:27

Too bad the Material ID script didnt work,

But something else you could do.. If you don't have many materials,
there is a shader in Holgers' BA Essentials Pack that can store a color (or texture) in a channel,
without it participating in your main RenderTree.

If you can see what I'm getting at.. you could then pipe a constant with a unique color in each of your materials, and you should be good to go..

If you DO have many materials, there is a Batch Material Processor thing
that can replace or insert nodes, that is made for just this sort of thing..

(Sorry don't remember names, but you can look it up on RRay.de for the Material procesor,
and BA Site to find out which shader is the store in channel thing in the Essentials pack )

Let me know how it goes!

J

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Material ID pass ??

Post by FXDude » 16 Apr 2013, 08:49

Also if you dont have *too* many materials, (while perhaps remaining viable with quite a few materials)

to avoid aliasing issues with Material IDs.. :

- you could store 4 different materials per color channel (4 per frame-buffer output, in the same resolution as you main render)
One material 100% Red, One Green, One Blue, and One 100% Alpha
(you can put things in alpha with the RGBA Combine Shader)

So if you have 20 materials, you could have 5 frame-buffers containing 4 perfectly antialiased material puzzle tiles each,
one in each of their RGBA channels.

Saved as PNGs' (lossless & low disk space especially for constant colors) .. no need for EXRs'

Falam

Re: Material ID pass ??

Post by Falam » 16 Apr 2013, 16:08

@FXDude - It wouldn't be MM_ShaderTools ?

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Material ID pass ??

Post by FXDude » 16 Apr 2013, 23:08

Yes! MM_Shader tools! Saved a number of people.. also very useful for switching renderers!

Falam

Re: Material ID pass ??

Post by Falam » 17 Apr 2013, 05:01

It's the color switcher node, that I believe does what you describe in the BA Essentials collection. Unfortunately I don't have a clue on how to use it. I looked for some in-depth manual on how to use it, since the shader web page information is lacking. From what I know is others find it very useful, hopefully I will too :)

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests