how to set up n materials for n render engines?

   2388   3   2
User Avatar
Member
63 posts
Joined:
Offline
Hi all,
I am trying to start using the component builder in h19 to author usd assets for my asset library. This seems like a super cool way to do things, but I am bumping into a few issues I currently cannot figure out.

So, inside the material library creating one material x for karma, one rs material for redshift, use a collect node and then, in the viewport, switch between the renderers works.
Now comes my issue: I have an object consisting of multiple seperate meshes. These meshes has primitive groups with names according to what they are. Now I want to set up multiple materials, say 1 rubber mtl, 1 plastic mtl, 1 metal mtl, and assign them to the various meshes of this object as needed. In the component material node I can hook up primitives to materials using geometry subsets derived from my group, in the multiparm, to add as many materials as I need. That works as long as I am only using my material x for karma.
However...
How do I now set up the same amount of materials for redshift in such a way that when I switch my renderer in the viewport I switch to the redshift materials that are supposed to use the same "groups"/subsets?? Because by setting up the material assignments manually they seem to override everything.
Is there a way to solve this issue INSIDE the material library such that everything can be wired to a collect node and work as when you have only to switch between two materials that are assigned to the whole object? In other words can I get access to my groups/subsets inside the material library? Or is there another way to do this?
Also, can one chain together several collect nodes? As in when one has to use a collect node to pipe in displacement but need more collects to grab the materials from other render delegates?

Thanks,
Dag
User Avatar
Staff
1448 posts
Joined: July 2005
Offline
It's the Material (not Shader) primitives that are assigned to geometry subset. So if it works for Karma it should work for all other renderers whose Shader prims are available in the Material prim as the terminal shader.

Materials and geometry are separate entities (eg, one material can be bound to several geometries). So, you can't access groups/subsets inside the material library. But, as mentioned, you should not need to. If it works in Karma, then switching the viewport to Redshift should work too. Both shaders are part of the same material, and it's the renderer that chooses which shader from that material it want to execute.

And, nope, you can't chain several collect nodes. You can wire as many shaders to a single collect node.
User Avatar
Member
63 posts
Joined:
Offline
Thank you for your answer rafal. I still struggle to understand this though. So, I've attached a test scene to better illustrate what I mean. Perhaps someone can have a look inside and let me know what I am doing wrong here?

Thanks,
Dag

Attachments:
test.hiplc (556.0 KB)

User Avatar
Staff
1448 posts
Joined: July 2005
Offline
Inside "materiallibrary4" LOP, you connect several MaterialX shaders to the same Collect VOP. But you are allowed to connect only one MaterialX shader. You can connect another shader, but it needs to be a different "language". Eg, you can connect a redshift shader. The reason is that USD Material primitive can have only one terminal shader for a given render context (eg, "mtlx").

So in "materiallibrary4" LOP, you need to have three Collect VOPs that will author three USD Materials. Each Collect VOP can have one MaterialX and one Redshift shader.

Then in componentmaterial you can assign each USD "collect" material to each of the shapes.
  • Quick Links