I would like to do some minor edits to the MtlX Standard Surface. Is there a version of the shader that's made from individual nodes?
If not could it be made available? It would be a great learning resource too.
Edit MtlX Standard Surface?
2523 10 2- daviddeacon
- Member
- 165 posts
- Joined: Jan. 2019
- Offline
- Enivob
- Member
- 2544 posts
- Joined: June 2008
- Offline
There's a couple of ways to approach that. One is to set some value on the MTLXStandardSurface node that you want to persist, then right-click and choose Make Permanent Default. Then any new creations of the MTLXStandardSurface will contain your edits.
If you drop down a USD MTLXSubnet and dive inside, you'll discover the barebones version of a surface that you can edit for your needs.
In LOPs there is also the editmaterialproperties node to non-destructively modify parameters.
If you drop down a USD MTLXSubnet and dive inside, you'll discover the barebones version of a surface that you can edit for your needs.
In LOPs there is also the editmaterialproperties node to non-destructively modify parameters.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- daviddeacon
- Member
- 165 posts
- Joined: Jan. 2019
- Offline
I'm looking to edit the core functionality of the shader, so would need lower level access to the mtlx nodes that make up the MTLXStandardSurface.
The specific edit I'm looking to make is decoupling, the IOR of reflection and refraction. So they have their own IOR value, this is an artistic choice, and is something we do in VRay but looking to replicate in Karma CPU and XPU.
The specific edit I'm looking to make is decoupling, the IOR of reflection and refraction. So they have their own IOR value, this is an artistic choice, and is something we do in VRay but looking to replicate in Karma CPU and XPU.
- pixelninja
- Member
- 33 posts
- Joined: March 2017
- Offline
The only thing I can think of is to rebuild it from bsdfs. Not ideal if you only need a minor change but it does give you full control over the shader.
Doesn't work with xpu yet though as far as I'm aware.
Here's a tutorial on bsdf based shader setups in case it's helpful.
https://youtu.be/FVmFFn7EPdA [youtu.be]
Doesn't work with xpu yet though as far as I'm aware.
Here's a tutorial on bsdf based shader setups in case it's helpful.
https://youtu.be/FVmFFn7EPdA [youtu.be]
- rafal
- Staff
- 1449 posts
- Joined: July 2005
- Offline
MtlX Standard Surface is a MaterialX shader, which means there is a single VOP (and Karma shader node on Karma side) that represents it, so you can't dive inside to see the implementation details.
However, that shader node is implemented as a network in MaterialX: $HH/materialx/libraries/bxdf/standard_surface.mtlx
This means you could take that MaterialX file and edit it to come up with your own version of the shader. Of course, it should be named differently etc. But once you have your own .mtlx file with your own shader, you can use `mtlx2hda.py` and `mtlx2karma.py` scripts to build the VOP and Karma shader node that are needed for the shader UI in Houdini and the execution implementation for Karma.
See also:
https://www.sidefx.com/forum/topic/83604/ [www.sidefx.com]
https://www.sidefx.com/forum/topic/83563/ [www.sidefx.com]
However, that shader node is implemented as a network in MaterialX: $HH/materialx/libraries/bxdf/standard_surface.mtlx
This means you could take that MaterialX file and edit it to come up with your own version of the shader. Of course, it should be named differently etc. But once you have your own .mtlx file with your own shader, you can use `mtlx2hda.py` and `mtlx2karma.py` scripts to build the VOP and Karma shader node that are needed for the shader UI in Houdini and the execution implementation for Karma.
See also:
https://www.sidefx.com/forum/topic/83604/ [www.sidefx.com]
https://www.sidefx.com/forum/topic/83563/ [www.sidefx.com]
- daviddeacon
- Member
- 165 posts
- Joined: Jan. 2019
- Offline
Hi Rafal,
Thanks for your explanation and links to the resources.
I had started rebuilding the MtlX Standard Surface from bsdfs like pixelninja mentioned, but released they don't work in karmaXPU.
Will I have the same issue when using `mtlx2hda.py` and `mtlx2karma.py` method?
David.
Thanks for your explanation and links to the resources.
I had started rebuilding the MtlX Standard Surface from bsdfs like pixelninja mentioned, but released they don't work in karmaXPU.
Will I have the same issue when using `mtlx2hda.py` and `mtlx2karma.py` method?
David.
Edited by daviddeacon - March 20, 2023 12:50:27
- goldleaf
- Staff
- 4175 posts
- Joined: Sept. 2007
- Offline
- daviddeacon
- Member
- 165 posts
- Joined: Jan. 2019
- Offline
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Online
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Online
rafal
MtlX Standard Surface is a MaterialX shader, which means there is a single VOP (and Karma shader node on Karma side) that represents it, so you can't dive inside to see the implementation details.
However, that shader node is implemented as a network in MaterialX: $HH/materialx/libraries/bxdf/standard_surface.mtlx
This means you could take that MaterialX file and edit it to come up with your own version of the shader. Of course, it should be named differently etc. But once you have your own .mtlx file with your own shader, you can use `mtlx2hda.py` and `mtlx2karma.py` scripts to build the VOP and Karma shader node that are needed for the shader UI in Houdini and the execution implementation for Karma.
See also:
https://www.sidefx.com/forum/topic/83604/ [www.sidefx.com]
https://www.sidefx.com/forum/topic/83563/ [www.sidefx.com]
Is there a trick to these? I tried mtlx2karma, and the result just hard crashes Houdini when I try to render with Karma using the new NodeDef.
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Online
-
- Quick Links