Jump to content

How can pass several materials to several objects, using an id ?


Recommended Posts

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. 




Link to comment
Share on other sites

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".



Link to comment
Share on other sites

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...

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.

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...