Importing a .mtlx document using the Interchange materialX Pipeline, a Standard Surface comes in with its base color set to Linear Color in the material, and sRGB=false in the texture. This is despite the fact that the image in the .mtlx file is set to colorspace=“sRGB”.
What would be the best way to modify this? The ideal would be to have the color space set on the image in the MaterialX file to determine how to translate the image. colorspace=“sRGB” would result in sRGB=true in the texture, and Color as the Param2D sampler type. colorspace=“raw” would result in sRGB=false and sampler type Linear Color. However, I suspect that the UE translator may not be looking at the color space of the .mtlx file.
As a workaround, I’d like the have it default to reading in textures as sRGB, with the exception of detected normal maps. Could someone point me to where/how I can change that? Would this be done by creating a custom MX_standardSurface material instance, or would it involve changing the C++ of the Interchange MaterialX Translator and/or the Default MaterialX Pipeline?
I think I found a workaround, sharing it here for anyone else with the same question. I created a copy of the material function MX_StandardSurface that I then used that new material function in Project Settings > Interchange MaterialX.
For the custom MX_StandardSurface I inserted an inverse gamma into the base color input (and for any other inputs you want to use sRGB) like this:
When creating materials via LookdevX in Maya, an sRGB texture’s color space is written as “sRGB” in the .mtlx file, instead of “srgb_texture.” So, I have to manually edit each .mtlx file in Notepad. This is quite tedious. Is there any solution for this? I’m using UE 5.3.2.
You can edit your OpenColorIO config to use srgb_texture instead of sRGB. Generally you want to have a config that is set up to work with all your DCCs.