MaterialX Layer has limited functionality.

   5736   12   4
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hi,

I have recently been creating the Lama node definitions inside of Solaris using the MaterialX BSDFs and the Node definitions from MaterialX and I noticed that the mtlxlayer node doesn't have the functionality described by MaterialX

in the pbr spec it states:

If transmission scattering is enabled the node may be layered over a VDF describing the surface interior to handle absorption and scattering inside the medium, useful for colored glass, turbid water, etc.

The mtlxlayer (layer) should support the layering of vdf and bsdf with an output result of bsdf.

It seems this is currently not supported and I was wondering if this will be possible in the future, otherwise a true implementation of the lama nodes defined by MaterialX is not possible.

Best,
Rich
Edited by Hypershader - March 21, 2022 09:16:55

Attachments:
vdxbsdfedftest.png (26.3 KB)

User Avatar
Staff
1455 posts
Joined: July 2005
Offline
The MaterialX VOP nodes in Houdini directly reflect the MaterialX shader definitions in .mtlx filed.

So, even thought the .pdf document stipulates that the ND_dielectric_bsdf node's parameters can be set up to "handle absorption and scattering inside the medium", the actual definition of the ND_layer_bsdf in the pbrlib/pbrlib_def.mtlx specifes only 'BSDF' as the input types. Ie, the layer shader does not have a version that would accept VDB as an input.

So basically, it's the MaterialX 'layer' shader node shortcoming.
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hi Rafal,

Thanks for the speedy answer.

I'm assuming this is due to Houdini not using the most up to date version of MaterialX?

When I take a look at the pbrlib_def.mtlx there is a ND for ND_layer_vdf which takes a VDF base and a BSDF top.

Since the Lama definitions were only put in since 1.38.2 I'm also assuming this definition was not around in the version implemented into Houdini which im guessing is just using 1.38.0?

If so this makes sense and i hope an update for this can be released at some point in the future.

Also us it possible to make our own MaterialX VOP nodes based on the ND's for the time being or is this not available for public access? and are there any resources available for writing shaders for karma?

Thanks for your help,
Rich
Edited by Hypershader - March 21, 2022 13:38:44

Attachments:
nodedef.png (33.2 KB)

User Avatar
Staff
1455 posts
Joined: July 2005
Offline
Hypershader
Since the Lama definitions were only put in since 1.38.2 I'm also assuming this definition was not around in the version implemented into Houdini which im guessing is just using 1.38.0?
Yes. I think Houdini uses 1.38.1. It will be updated eventually to the newer one.

Hypershader
Also us it possible to make our own MaterialX VOP nodes based on the ND's for the time being or is this not available for public access? and are there any resources available for writing shaders for karma?
Yes, you can add new shader VOP HDAs, or you can copy and extend an original HDA.

https://www.sidefx.com/docs/houdini/solaris/shader_framework.html#creating-a-new-shader-hda [www.sidefx.com]
User Avatar
Member
37 posts
Joined: March 2017
Offline
amazing! thanks again!
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hey,

I was wondering how I can go about using the mtlx2hda.py script mentioned in the documentation you sent over?

Best,
Rich
User Avatar
Staff
1455 posts
Joined: July 2005
Offline
That question became a new forum thread, which has a more elaborated answer:
https://www.sidefx.com/forum/topic/83604 [www.sidefx.com]

But as a summary here:
hython mtlx2hda.py --help
Edited by rafal - March 24, 2022 11:36:22
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hey,

So I used mtlx2hda to update to the latest pbrlib_defs.mtlx and all the nodes seem to work as expected apart from the layer.

When updating the HDA we do get the VDF option but for some reason we cannot layer a dielectric on a VDF and get a result.

I'm assuming this is due to the limitation that Karma does not currently support Surface and Volume materials on the same prim.

Best,
Rich
Edited by Hypershader - March 24, 2022 14:37:02

Attachments:
customLayerNode.png (422.0 KB)

User Avatar
Member
8043 posts
Joined: Sept. 2011
Offline
Hypershader
When updating the HDA we do get the VDF option but for some reason we cannot layer a dielectric on a VDF and get a result.

I think the hdas only add nodes, they don't tell the renderer anything about what they mean.
User Avatar
Member
4 posts
Joined: May 2017
Offline
Hypershader
Hi,

I have recently been creating the Lama node definitions inside of Solaris using the MaterialX BSDFs and the Node definitions from MaterialX and I noticed that the mtlxlayer node doesn't have the functionality described by MaterialX

Hey Rich,

did you finally get LAMA to work with Solaris? I've been told it needs MaterialX 1.38.2 whereas the latest H19 builds are still only shipping with 1.38.1

Cheers
Oli
CG Supervisor @ RISE | Visual Effects Studios - Munich
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hey Oliver,

Due to the lack of support for Absorption in karma it is not possible for the time being to have the exact definitions working as expected for dielectrics.

I used Mtlx2HDA and managed to successfully create all the nodes needed to recreate the definitions present in 1.38.2 and onwards but due to karmas lack of functionality for absorption, it’s currently unsupported.

I also ran the lama definitions through Mtlx2HDA with no luck for all nodes apart from layer, mix etc.

For the most part, all other Lama Definitions work fine! When reconstructing with the nodes in the nodegraph Eg. Lama Diffuse, lama sss, lama layer, lama mix, and so on.

I have had some minor issues with the Conductor Definition as for some reason the Thinfilm BSDF cannot take a node input despite having input ports on the node. I’m assuming this is a bug on sideFX side. This means you can’t have the same ior/thickness calculations described in the lama definitions. But if you wanted to exclude Thinfilm and have a limited lama definition than it’s possible.

You also cannot layer a Thinfilm BSDF over a conductor in karma as described in the lama Defintions so you have to layer the Thinfilm on a dielectric and then layer that on top on the Conductor to get it to work so this will need to be supported too.

That being said, these seem to all be very minor bugs which will be addressed in upcoming releases.

So all in all, yes, you can have the lama nodes operate “fine” with limited functionality for both dielectric and conductors. And full support for all other nodes according to the current Mtlx Definitions. There are some limitations like karmas lack of custom lobe naming for use in AOVs. Rendermans implementation has some additional features not defined in the Mtlx Lama Defintions and according to the MaterialX Slack there may be some updated defintions to come to match the Mtlx Defintions closer to the Renderman Defintions.

I hope the conductor issues due to the Thinfilm BSDF will be fixed when updating to 1.38.2 or higher definition as it seems like a small bug but for the dielectrics we will have to wait until absorption is supported in karma. even if the hdas are updated to 1.38.2 definitions this won’t work until absorption is supported.

Hope this clears some things up!

Best,
Rich
User Avatar
Member
4 posts
Joined: May 2017
Offline
Thanks a lot for the quick reply Rich!

Hypershader
I used Mtlx2HDA and managed to successfully create all the nodes needed to recreate the definitions present in 1.38.2 and onwards but due to karmas lack of functionality for absorption, it’s currently unsupported.

So you say that even though H19 only ships with MaterialX 1.38.1 you were able to just grab the definitions needed by Mtlx2HDA from 1.38.2 and they still work (besides the limitations you posted)?

The reason I am asking is bc we want to use the MaterialX LAMA nodes with prman and not karma, but ofc we have to turn them into HDAs before we can use them with hdPrman. Have you tried your definitions with renderman by any chance?
CG Supervisor @ RISE | Visual Effects Studios - Munich
User Avatar
Member
37 posts
Joined: March 2017
Offline
Hey,

Just did a quick test and it seems the mtlx standard surface run great with prman but not the bsdfs, mainly the surface node cannot be translated to osl with the current version of MaterialX shipping with houdini

I've also tried lama defintions generated from mtlx2hda in renderman with no luck throwing a similar error

I'm assuming this is due to the osl generations not being fully supported at the moment in 1.38.1. in this case waiting for sideFX to ship with a later version may cause it to work but due to a lack of closure support I thought renderman couldn't use osl for
bsdf shaders. I haven't looked into getting MaterialX to work with renderman too heavily so im not too sure what exactly is going on under the hood to allow for MaterialX support for standard surface and not the bsdfs/lama nodes as at the end of the day, the standard surface is defined from the bsdfs. I dont know if theres some sort of translation under the hood mapping the standard surface to pxrsurface or something like that instead. probably a good idea to ask someone on the prman team.

I know there are some pretty significant changes happening to OSL at the moment to allow greater support for MaterialX so that may also be something that will make this easier to deal with. but I'm probably not the best person to ask as I haven't done a huge amount of research into MaterialX support for prman.

I hope you find a solution! and if so id love to hear how you went about it!

Best,
Rich
Edited by Hypershader - April 14, 2022 04:37:08
  • Quick Links