When I try to load that materialx file using the reference node, I get the following warnings and the material doesn't work:
Shader not found at </MaterialX/Materials/mixed_material/NodeGraphs/surface1> for input "fg" Shader not found at </MaterialX/Materials/mixed_material/NodeGraphs/surface2> for input "bg"
However, if I create my materialx material directly in Houdini, then I am able to mix surfaceshader types no problem.
Can anyone point out to me what I'm doing wrong? Thanks in advance!
In short, the issue is with the MaterialX file format plugin (usdMtlx lib) in the USD library.
Houdini/Solaris supports the MaterialX standard specification, but it does not directly rely on the .mtlx (XML) data storage or the implementation of code generation. Because Solaris is heavily USD-centric, it leverages USD's support for loading .mtlx documents into USD stage, and then processes them as any other USD Shade Material primitive. And also, Karma does not use code-gen from the mtlx library; it directly implements the shaders itself, based on the spec (and OSL/GLSL as an example).
These days pattern shaders can live directly inside the <material> element as siblings of the final surface shader, but USD plugin did not get updated for that yet. There is ongoing work on it so hopefully it will be able to handle your .mtlx file layout soon too.