Currently, the MaterialX import default pipeline does not flip the green (Y) channel for normal maps. It is the standard for MaterialX to flip the green channel, so this should be the default behavior.
This option is exposed on the generic import pipeline, but the MaterialX one does not have this option exposed in the GUI. It has a note that this can be changed in the Project Settings, but unclear how that should be accomplished.
I’m requesting that the default behavior be changed to flipped green for normal maps, and/or that the option be exposed to users.
1 Like
Hello Derek,
which version of UE are you using?
In my 5.5.4 I have the option here
Granted it is deactivated by default.
Once you confirm your version and why you do not see the option I will share a way to change that default for you.
Do you mind pointing me to where you saw the “It is the standard for MaterialX to flip the green channel”, I quickly browsed the spec but could not find this info yet.
I probably should not have said it was “standard” as it seems to have a lack of one. Generally speaking, games tends to use DirectX-style (flipped green channel) normal mapping while renderers like Renderman, Arnold, Vray, etc generally use OpenGL-style normal maps.
I should also clarify that I’m thinking of this in the context of USD + MaterialX. FWIW, here’s something about normal maps in OpenUSD McUsd/unit_tests/cubes_r_normals at main · erich666/McUsd · GitHub which states that OpenGL is the “default” style normal map for USD.
Since one of the core concepts of OpenUSD and MaterialX is interoperability between DCCs (Unreal, Maya, Houdini, etc.) I was thinking that OpenGL should be the default. An example of this is the OpenChess set. assets/full_assets/OpenChessSet at main · usd-wg/assets · GitHub which if you read into Unreal needs to have the normals flipped in Y (i.e. green).
All of that to say why I was proposing that the default for MaterialX should be to assume normal maps are OpenGL style.
I am aware that you can switch to “Default Materials Pipeline” and then get all the options, including the flip normals option. However the “interchange MaterialX pipeline” does not have those options available, and defaults to assuming DirectX normal maps. When you load a USD stage with MaterialX you do not get that window.
I did try changing the Project Settings to “Default Materials Pipeline” for engine > interchange > materialX and ended up crashing Unreal (5.5). This is likely user error on my end, but if you would be so kind as to advise how to set this properly I would be most appreciative.
Thank you for the explanation I will pass that to the team.
What you should do is the following, replace the default material pipeline that is used for MaterialX import.
-
Go into Interchange > Import Content > Materials > Per translator Pipelines > MaterialX translator and locate the DefaultMaterialPipeline asset.
Alternatively the asset is here /All/EngineData/Plugins/Interchange/Pipelines. Do not modify it directly.
-
Duplicate that asset somewhere in your project. I created a CustomMaterialPipeline
-
Edit this asset and change your default values as you please.
-
Go back in your project settings > Interchange … > MaterialX import pipelines and replace the first pipeline “DefaultMaterialPipeline” with “CustomMaterialPipeline”
Now it should work. You might have to clear cache, or restart project to be sure USD import is reimporting assets and rebuilding material and not using assets already imported.
The engine > interchange > materialX is where you should go to replace material function used by UE to build Material coming from MaterialX import.
If you are not satisfied with the Unreal shader representation Unreal provided by default for one of the MaterialX Shaders then you are free to design your own material function and make UE use it.
This works, thanks so much for your help!