Combine MtlX/Karma Materials in Material Chain

   748   1   1
User Avatar
Member
68 posts
Joined: Nov. 2021
Offline
Hey,
I am trying to understand how to use the "next" input on Mtlx and Karma Material Builders in Solaris. I thought I could import and export stuff between shaders using these but I'm either doing it wrong or it's bugged/not meant to work this way.

Whenever I try to plug something into the "next"-input it just breaks the shader and it looks like no shader is assigned at all.

Can someone explain how to properly use this or if this is even implemented at all? Also whenever I connect something to "next" and unplug again, the names of the inputs and outputs get all messy and don't even change back after Ctrl+Z.

I'm trying to add an ice shader on top of my objects and thought this would be a more flexible and elegant way of doing it instead of copying the ice shader into every single existing material.

Here's a breakdown of what I'm doing:
1. Create ice shader and mask and connect it to output


2. Import ice shader and mask into shaders


3. Mix object shader and ice shader using the mask


I've also attached the HIP file.

Cheers!
Edited by eaniix - June 23, 2025 13:57:52

Attachments:
1-create-mask-and-ice-shader.png (30.1 KB)
2-connect-to-shaders.png (23.3 KB)
3-mix-shaders.png (27.5 KB)
karma_material_chain.hipnc (303.9 KB)

User Avatar
Staff
1471 posts
Joined: July 2005
Offline
The issue here is that USD does not allow connections to the Material primitive inputs. And in your setup, "sphere" and "box" are translated as USD Material primitives. The main reason is that USD wants to ensure that when a Material prim is referenced, all its dependencies are encapsulated inside it. Having external connection would break that assumption.

The builder VOPs have inputs because when they are nested inside another builder, they no longer are translated as a Material but rather as a ShaderGraph primitive.

One approach to what you are trying to do is to define a single "ice" NodeGraph on the USD stage, and then reference it inside each of the object material builders. Essentially your "inputs" node (in step 3) would be replaced by the ice NodeGraph reference VOP. You can create such VOP using "Import USD Material" or "Specialize USD Material" tool int he Tab menu.
  • Quick Links