Mtlx conversion complaining about lumacoeffs

Hello Nvidia,
I was trying to load some mtlx materials encoded as usd into omniverse. Many things worked, but I use the luminance node to convert some color channels to scalars. The coefficients are not connected, yet I get a lot of errors like these. Is this a known issue?

thanks,
Koen

2025-02-06 22:30:30 [Warning] [omni.hydra] [Network::_setParameter()]: ‘(0.33333334, 0.33333334, 0.33333334)’ is not a valid option for parameter ‘lumacoeffs’ on node: ‘/world/appliance_espresso_machine/mtl/appliance_espresso_machine/layer0__NESTED__fusecolor__NESTED__non_metal’ in material: ‘/world/appliance_espresso_machine/mtl/appliance_espresso_machine’, setting to ‘0’

2025-02-06 22:32:28 [Error] [omni.hydra] [UsdToMdl] Prim ‘/world/appliance_espresso_machine/mtl/appliance_espresso_machine/standard_surface’ parameter ‘layer1__NESTED__opacity_luminance_lumacoeffs’: Reached invalid assignment. Tried to assign a ‘int’(USD) to a ‘color’(MDL).

I am assuming from your post you mean you have bought a material X library that has been saved in the USD file format. Is that correct?

If I were honest, I would say that this is not an ideal workflow right now. Whilst we support basic material X importing, it has to be done in a certain way. I always strongly recommend that all material workflow is done native inside USD composer. We have a massive amount of library assets, and great materials. I would strongly recommend you creating the materials from our material library inside USD composer. Material X support is limited, and we have no way to guarantee that the material library are trying to get in will work.

Hello Richard,

Thanks for the response.

I create these myself. I have an mdl version of our shader, but to be compatible with a wider collection of dcc’s I am converting our shader to mtlx, in the hope omniverse would be able to deal with this as well. When I say encoded in usd, all I mean is that I store the graph as usd shade nodes as opposed to the xml document a .mtlx file is.

Omniverse is just one of the consumers of this shader ( maya, max and houdini being others ). None of those complain about this luminance node ( I just use it to convert a color channel to a scalar channel). I suspect there to be a bug in the mtlx to mdl code omniverse runs with respect to the luminance node, all other nodes convert fine.

Thanks,
Koen

For reference, you can see a very early version of the mdl version of my shader in this video:

NVIDIA Omniverse: Exploring DeepSearch with Activision

Have you thought about using OmniPBR?

OmniPBR would make it very hard to use in maya, houdini, max and blender. It is more important the shader works in those contexts. MaterialX is great for this.

Well I can ask our material expert, about this and find out.

Can you take the “lumacoeffs” out of the material? It is required in the other programs?

Hi @koen2
Can you post a repro? When I made a graph using UsdShade MaterialX I didn’t have issues with type mismatching. Maybe it’s the version of Kit and MaterialX that you’re using. Can you tell me which Kit or Composer you’re loading?

luminance_mtlx.zip (5.4 MB)

Hey Frankie, I’ll share the scene with you offline. I am running kit / composer from the latest kit app template on github. I’ll add the log to the files I’ll send.
This is omniverse vs karma:

( I pinged you on the aswf slack )

Let me know when you send the scene. Please attach the link here.

Hello Richard,

As this was production data, I shared it directly with @fpliu .

He took a look and there indeed seems to be an issue in the mtlx to mdl conversion on the luminance node. Mdl has hard coded coefficients set by an enum, so it expects an int as input, while mtlx defines the input as a float3. This causes issues in omniverse .

Thanks,
Koen

@koen2 fyi, Kai posted a PR to fix lumacoeff. MDL: improve mx_luminance_color* implementation by krohmerNV · Pull Request #2224 · AcademySoftwareFoundation/MaterialX · GitHub

Great. Glad you are getting to the bottom of this.

Nice, thanks Frankie!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.