soroush Posted March 4, 2017 Share Posted March 4, 2017 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 Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted March 5, 2017 Share Posted March 5, 2017 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. Quote Link to comment Share on other sites More sharing options...
soroush Posted March 6, 2017 Author Share Posted March 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
6ril Posted March 6, 2017 Share Posted March 6, 2017 would be great if mantra adopt the cryptomatte plugin ! Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted March 6, 2017 Share Posted March 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
soroush Posted March 7, 2017 Author Share Posted March 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted March 7, 2017 Share Posted March 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
soroush Posted March 7, 2017 Author Share Posted March 7, 2017 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? Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted March 7, 2017 Share Posted March 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
soroush Posted March 7, 2017 Author Share Posted March 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
el_diablo Posted March 7, 2017 Share Posted March 7, 2017 Another automatic option is to just hash the object/material names and use that to lookup a hsv to your liking. Its also pretty stable across multiple scenes, as long as your names don't change. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.