Jump to content

Material ID pass


Recommended Posts

Hi,

I would like to know what is the fastest way to get the material id pass based on different materials?

My scene is not really complicated, I have only 7 shaders in total so it is possible for me to assign nodes to my shaders if it is needed.

Also I am using both Mantra Surface and Principled Shaders in my scene.

I have google it but anything I found was old from years ago, so I thought Houdini must have a new way to get the MatID pass.

Thanks

Link to comment
Share on other sites

There is still no out of the box way to do an Material ID pass. You'll have to crack open your principal shaders, or make a new a new compiled hda one. Where you expose a parameter vop that connects to a bind export export that you name MatID, and then pull those into the mantra render with an extra image plane name called MatID. It might be worth making the RFE for that. It's simple enough and it has been an issue for long enough. The only issue is for opacity, which is one reason they may have not implemented it. This is why people do RGB passes and do 3-D compositing to handle this issue of opacity. If you have the band width the 3-D compositing is an amazing solution. If it is just a simple setup with opacity RGB passes still work. If there is no opacity, the MatID pass as mentioned above should work good enough. 

Link to comment
Share on other sites

8 hours ago, LaidlawFX said:

There is still no out of the box way to do an Material ID pass. You'll have to crack open your principal shaders, or make a new a new compiled hda one. Where you expose a parameter vop that connects to a bind export export that you name MatID, and then pull those into the mantra render with an extra image plane name called MatID. It might be worth making the RFE for that. It's simple enough and it has been an issue for long enough. The only issue is for opacity, which is one reason they may have not implemented it. This is why people do RGB passes and do 3-D compositing to handle this issue of opacity. If you have the band width the 3-D compositing is an amazing solution. If it is just a simple setup with opacity RGB passes still work. If there is no opacity, the MatID pass as mentioned above should work good enough. 

Thank you Ben, I am going to try the method you mentioned.

Link to comment
Share on other sites

I've used the "op_id" variable to some of my projects, the good thing is that is really easy to set it up and in nuke or even in Houdini if you normalize it you can get your id's with keyer very easy but nothing beats deep compositing for that.

Link to comment
Share on other sites

I have found the link below that the person put a sample file. I looked at it and tried to do the same things on my shaders.

https://www.sidefx.com/forum/topic/30157/

there was no problem for the Mantra Surface nodes because they have the Dif Int input. but for the Principled shader I don't see the Dif Int input!

any way to add that attribute to the principled shader?

 

Michel I am googling your method now.

Link to comment
Share on other sites

1 hour ago, soroush said:

I have found the link below that the person put a sample file. I looked at it and tried to do the same things on my shaders.

https://www.sidefx.com/forum/topic/30157/

there was no problem for the Mantra Surface nodes because they have the Dif Int input. but for the Principled shader I don't see the Dif Int input!

any way to add that attribute to the principled shader?

 

Michel I am googling your method now.

Don't worry about the dif input in those shaders the only thing you need from those shaders are the floating, JKID or Op_Id parameter nodes in the shader. The rest of the principled shader can remain the same.

Link to comment
Share on other sites

9 minutes ago, LaidlawFX said:

Don't worry about the dif input in those shaders the only thing you need from those shaders are the floating, JKID or Op_Id parameter nodes in the shader. The rest of the principled shader can remain the same.

Do you mean that I can have some nodes without any connections to my other nodes?!
So just copy that JKID in my shader is enough?

Link to comment
Share on other sites

18 minutes ago, soroush said:

Do you mean that I can have some nodes without any connections to my other nodes?!
So just copy that JKID in my shader is enough?

Yup! 

Don't do it with a multiply node for sure, or the compile will fail. However leaving stray parameter of bind vops works, especially as pass through nodes. i.e. creating random additional ui parameters, or shuttling attributes from sop to shop/vops to out. I will put a small * as it may be a bit more dependent where in the new material networks in Houdini 16 you place them, I think they will still need to be in a material shader builder to be picked up the same way.

Link to comment
Share on other sites

3 hours ago, LaidlawFX said:

Yup! 

Don't do it with a multiply node for sure, or the compile will fail. However leaving stray parameter of bind vops works, especially as pass through nodes. i.e. creating random additional ui parameters, or shuttling attributes from sop to shop/vops to out. I will put a small * as it may be a bit more dependent where in the new material networks in Houdini 16 you place them, I think they will still need to be in a material shader builder to be picked up the same way.

Great! I am using Houdini 15.5 and it works well.

Thanks a lot.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...