Masoud Posted February 18, 2020 Share Posted February 18, 2020 Hello; I want to pass several different materials to several objects, using an id attribute. I add an "Assemble SOP" to create needed id and a Bind SOP in material network, to switch between shaders, but it doesn't work! Any ideas to fix it? Thanks for helping. Cards_01.hip Quote Link to comment Share on other sites More sharing options...
davpe Posted February 18, 2020 Share Posted February 18, 2020 hey, there is a few issues with your shader setup. 1. you can't just use a switch to blend shaders. there is a layer mix VOP to do that. 2. if you do a custom stuff like this, you need to use Layer output nad plug it into Compute lighting VOP and Output surface variables VOP (this is otherwise embedded in the Principled shader if you use it's Surface output). 3. depends on what are u trying to achieve but if it's just a texture variation you can do this much more simply and efficiently with only one Principled VOP and string attribute that can overwrite a texture path per primitive. cheers. Cards_01_fix.hiplc Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 18, 2020 Author Share Posted February 18, 2020 Hi "davpe" I don't want to blend shaders. I would like to switch between different materials (They will be different in texture, reflection, and so on), based on an attribute like "ID". And as you can see in my scene, I want to change the number of scattered points and copies of objects. Actually it works when I use the same workflow to assign different "colors" as input of one "principled shader". Cheers. Quote Link to comment Share on other sites More sharing options...
davpe Posted February 18, 2020 Share Posted February 18, 2020 well, "switching" materials at render time is not possible I'm afraid. switching colors and wiring it into a shader parameter is something completely different. for you to be able to render different materials on objects, you either have to blend layers as in example i sent, or you have to assign materials using shop_materialpath attribute (preferable in most cases, i think) if you only want to have different shader parameters per object, but otherwise having the same general qualities (like 100 different flowers, or book covers or whatever), the best way is to use attribs to drive these things per primitive, using a single material/shader. then you can also use material stylesheets. options are plenty... Quote Link to comment Share on other sites More sharing options...
anim Posted February 19, 2020 Share Posted February 19, 2020 (edited) deleted post, disregard (I missed the last post, so was pretty much along those lines) Edited February 19, 2020 by anim 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.