USD and MaterialX

Hi everyone!

I recently tested the usd/materialx workflow, unfortunately still unsuccessful.
I exported from 3ds max 2023 to a simple plane, a materialX shader to which I linked a .mtx file created with QuiltiX. In the end I exported everything as USD, exported materialX and unchecked USD preview.

I imported everything into Unreal Engine 5.3.1 using USD stage, created the cache and set “render context” to mtx (I even attempted to set it before opening the usd file) but the geometry didn’t have the material assigned.
However, I noticed that when I tried to import the .usd file, unreal created the material I had made in QuiltiX, also importing the textures. The point is that I have to assign it manually, which would be out of place on a very complex scene.

Is there anyone who has had the opportunity to use USD stage and materialX successfully and who can give advice and tell their experience?

Can you share the sample USD + mtlx + textures with us so we have a look?

sure, here’s the link:

1 Like

Something looks either badly formed or in a way UE is not expecting.
I will check with dev. thanks for the sample

Thanks for your interest. I would like to understand if there is at least a work around to solve the problem.

Got it to work by adding the remaining part of the path “/Materials/USD_Default” in the material binding in the USD file

rel material:binding = </root/mtl/Material__25/Materials/USD_Default>

I just downloaded the sample file from @Gladiator_FX95.
And followed @UE_FlavienP advice to change

rel material: binding = </root/mtl/Material__25>

to

rel material: binding = </root/mtl/Material__25/Materials/USD_Default>

I also changed the texture path of the three files that are included at the carpaint.mtlx
Afterwards I go in Unreal to Virtual Production > USD Stage → Render Context → mtlx
Loading \usd_mtx\usd\test_usd_carpaint.usd

But I don’t see any material:

Version: 5.3.1-28051148+++UE5+Release-5.3

The material is applied on a plane that loads inside the floor.
If you just need the material, you can import the mtlx directly.

We are conducting tests with USD and MaterialX. I’ve taken the file from this forum post, but I haven’t been able to make it work. When we import the complete USD, Unreal Engine is able to read the material, but it doesn’t automatically connect the textures, and we can’t connect them unless we import them from outside.

However, we’ve successfully read the same USD file in Maya 2024 using LookdevX, and it works flawlessly, recognizing the textures and everything. Back in Unreal Engine, if we automatically create the USDPreview in Maya 2024, the USDPreview material can indeed read the textures, but the MaterialX material still doesn’t connect them.

We’ve also conducted tests with a predefined asset using USDPreview, and it works without any issues. However, when we try to read the MaterialX material within the context, it doesn’t correctly create the MaterialX attributes.

We understand that having the .mtlx file is a necessary step, but even with the examples from materialx.org, we haven’t been able to replicate its use in USD.

Is there any example where USD works with MaterialX, USDPreview, and different contexts in UE5.3? This would help us analyze and identify where we might be going wrong. Thank you.

The Open Chess Set example here assets/full_assets/OpenChessSet at main · usd-wg/assets · GitHub that combines USD + mtlx works in UE5.3.

No luck with the chess set. Comes in without textures and throws a ton of errors. This is the top-level USDA file in the directory and loads into Houdini Solaris without issue. No idea what I’m doing wrong.

Did you enable the materialx render context?
By default UE is not using it

Sorry, I did, and it totally works now, thank you, my mistake.

I do have a related question about the chess set (this may be a shot in the dark?) : How does Unreal know to use the standard surface shader in this chess set rather than the preview shaders that show up in the USD project settings? Whenever I try to bring my own assets in, it will use an automatically assigned preview shader from Houdini instead of the material X standard surface model …and when I bypass the auto-generation of the preview shader in Houdini , my stage shows a mtlx standard surface assigned to the asset similarly to the chess set, but I get basically empty materials inside of unreal when switching to the mtlx context.
To clarify the preview shaders only display textures in the unreal or universal render context despite being autogenerated from a material X shader in Houdini. Anyway, super confusing but if you have any recommendations about how to solve this or where to look for answers I would greatly appreciate it.

In USD you can have several material definition for a material and UE allows you to switch between them. In USD stage you can see them in Options > Render context > Universal/Unreal/MaterialX/MDL. In USD import you have it in the USD Import Options dialog > USD Options > Render Context to Import.

  • Universal: is reading the default material definition in the USD
  • Unreal: is the default option, and is reading either an Unreal Material if it is specified or else will default to the same than universal.
  • MaterialX: if your material is using a MaterialX definition (as external file and not embedded in USD)
  • MDL: if your material is using an MDL definition.

Unreal material is basically reference to a path to an unreal asset in your project. When you export USD from UE you will always get the Unreal Material definition exported.
This is what you see in your case: you exported from UE so the Unreal material definition is present in the USD + UE default render context is “Unreal” so UE reads the USD and then tries to load the unreal material path that is empty because you did not copy your unreal material in the new project.

If your materials look empty when switching to MaterialX, that means there is an issue in UE reading MaterialX info from your USD. Either how the materialX is defined or how it is referenced inside the USD file.

Is your MaterialX referenced in your USD as an external MaterialX file or is it all embedded inside the USD file?

Do you get any warnings / errors?
Did you try to load the MaterialX file directly in UE and see if it comes properly?

I am having the same issues as above with USD and MTLX. I have a feeling that I might be misunderstanding how unreal is reading the files. It appears that my USD Preview material is appearing with appropriate maps assigned(also applied to the mesh) but my mtlx standard surface shader is not. The mtlx is within the usd and not a standalone mtlx file.

Hello, is it a sample you could share with US?
Which software generated that USD?

Hi thanks for the reply. Ill share two samples now, neither of which i have gotten working. We used maya for modelling and then Houdini for material assignment for the tree( the mtlx file is within this usd). For the cube, I just mede it in maya and used quiltx to assign the external mtlx.

I will also attach screenshots showing how each appear in maya vs unreal, Im a new account so i cant add them in this post. I have the same issue with both files:

Here are the files:

In each folder The USD i am loading is in Export\USD\master

I appreciate the help.

This is how they appear in maya vs unreal