Hi,
Super beginner question here: How do I “wrap” a Principled shader into a simpler digital asset that only exposes a few of the parameters?
I'm collapsing it into a subnetwork, then “promoting” the parameters I want, but it seems to break the material.
<edit>I think the problem is that when I turn it into a subnetwork, I can't drag the subnetwork directly onto an object, or select it as a “valid” material anymore. Is there a way to flag a subnetwork's output as a a valid material?
This is the digital asset's interface (param names are a little different than default Principled shader names):
This is what the asset looks like inside:
Explanation: I'm using a custom 3D engine with a PBR shader that uses a few of the same parameters as the Principled shader (with different names). I wanted to take advantage that Houdini already does a good job of displaying the parameters I need (roughness, metalness, etc) in the viewer, so I'm going to use that shader and export my materials' needed parameters to a .json file using a python script from Houdini.
However, when I collapse a Principled shader into a subnetwork so that I can convert it into a reusable digital asset, it instantly stops working! How do I get around that?
Please notice that properly understanding shader networks is well beyond my scope right now, I just wanted to reuse an existing shader and simplify its interface without building my own shader from scratch.
Any help appreciated.
Thanks!
"Wrapping" a principled shader into a Digital Asset
3628 3 1- Ethernaut
- Member
- 24 posts
- Joined: Oct. 2014
- Offline
- robsdesign
- Member
- 236 posts
- Joined: March 2015
- Offline
- jsmack
- Member
- 7733 posts
- Joined: Sept. 2011
- Online
Subnet nodes are not materials in 16+ (mat context). Use material builder nodes instead. There is an option to ‘collapse into material’ under the same menu where collapse into subnet is. This will create a node with a special collect node that allows individual shaders to be bundled together.
Something to keep in mind with wrapping a material in another material in this way, is that geometry attributes can no longer be automatically bound to shader parameters that only exist on the inner material. To ‘tunnel’ them through, promote the parameter from the inner material to the outer one with a parameter node. The ‘uv’ attribute will have this done automatically by the ‘collapse’ script.
Render properties also have to be manually managed when embedding a material that bundled render properties, as the principled shader does. For now, the only render property that is automatically propagated is the ‘vm_displacebound’ property.
Something to keep in mind with wrapping a material in another material in this way, is that geometry attributes can no longer be automatically bound to shader parameters that only exist on the inner material. To ‘tunnel’ them through, promote the parameter from the inner material to the outer one with a parameter node. The ‘uv’ attribute will have this done automatically by the ‘collapse’ script.
Render properties also have to be manually managed when embedding a material that bundled render properties, as the principled shader does. For now, the only render property that is automatically propagated is the ‘vm_displacebound’ property.
- goshone
- Member
- 21 posts
- Joined: April 2006
- Offline
jsmack
For now, the only render property that is automatically propagated is the ‘vm_displacebound’ property.
I have noticed that this has an expression (the exact same expression) in the vm_displacebound field, but it references parms that are on the original shader. So essentially, it appears that the properties node does nothing. There must be a reason for SideFX to create this node, but it escapes me. Can I just delete it, or do I need to reference the original vm_displacebound?
Thanks
Josh
-
- Quick Links