Maya to GLB RGBA channel issues

Hi there. Hope to get some answers here. I’m exporting to GLB from Maya using AiStandardSurface with textures from Substance Painter.
All my color maps need to and are 8 bit RGBA coming from Substance P. When I export from Maya they convert into 16 bit RGB. Any pointer on how to fix this? Thanks!

Maybe @PatrickRyan would have any idea ?

1 Like

@anna22, I am unable to repro the issue you are seeing. Can you share with me the versions for Maya and the Babylon Maya Exporter that you are using? Also, would you be able to share one of your source textures that you are finding the problem with? If you can’t share the actual texture file, can you export a test texture, just a simple smart material mapped to a cube or something similar, that you can repro the issue with?

Also, can you explain what tool you are using to determine the bit depth of the problematic images that are exported from Maya? I want to make sure I can see all the variables in the question to help determine what is going on. Thanks for your help!

1 Like

@PatrickRyan thanks a ton for looking into this for me. I know there are so many variables at play here. I really appreciate your fast reply!
I’m using Maya 2018.6 and Babylon 20200408.2 Please see find all the requested included. (2.2 MB)

1 Like

@anna22, I looked into your files and I can see the textures that are problematic are the base color and normal of the eye mesh which are these two source files:


I can see from your output window that the files are exporting as 8-bit, but I think it would be good to run a few tests with your source files. This is what you should do:

  1. First thing is to update your Babylon Maya Exporter as you are a bit behind. I don’t think this is a bug in the exporter because it is only affecting the textures of one of the meshes, but getting you up to the latest exporter will filter out any old bugs that have been fixed. If you don’t already have the installer tool on your machine, you can grab it from Releases · BabylonJS/Exporters · GitHub and download the file This will install a tool to allow you to update your Maya and Max exporters from one location and is much easier to open this tool and click update than manually installing the files. Once you are on release 20200813.4 you will want to try your export again to see if your issue resolves. If not move on to the next step.
  2. The second step is to try exporting your glTF file directly from Substance Painter to determine if we can repro the issue across multiple exporters. You can export directly to glTF using the glTF PBR Metal Roughness template that comes with Substance Painter. This will create a glTF file, a binary file, and each exported texture in your output directory. To test this out, select all of the files (glTF, bin, and textures) and drag/drop them into the sandbox to open them. You can then use the inspector to check for validation errors.

  1. Open the exported textures in photoshop or GIMP to determine the bit-depth of the image:

  2. The important thing is to keep cross checking the output to track down where the issue originating. Even check the original textures exported from Substance in GIMP or Photoshop to make sure that they are at the bit-depth you expect.

One thing you can do is to grab this tool made by @bghgary, one of the brilliant engineers on our team, which will enable a right-click conversion both ways between glb and glTF. What this enables is the ability to debug any glb because it unpacks the binary into the component files. It also gives you the ability to make some changes at the file level simply by opening the texture file, converting back to 8-bit and then saving it over the original png. You can then pack the glTF back into a glb for simplicity sake. This is definitely a work around while we figure out what’s actually going on, but it can unblock you in the mean time by correcting the output.

Let me know what you find out after running these tests and we can go from there.

1 Like

@PatrickRyan Cant thank you enough for your time looking into this. I will circle back with my findings asap. I’ve gone through the pipeline a couple of times but once I optimize the workflow I’ll have a better input on where the issue sits. Thanks again!

1 Like

I finally had a bit of time to try this workflow.
I’ve exported my .gltf file from substance painter. I need to plug in these textures in Maya so that I can animate the models.
Bellow is my workflow. There are so many settings at play. The documentation is not providing a step by step walk through for aiStandard , so anything can contribute to a weird outcome.

Will you please look over these settings and let me know if things look right to you?
Also which input selection do I choose for "Out color G " for the ORM node map?

Thank you again.

@anna22, I see one thing that is wired incorrectly which is your ORM B channel which should be going to metalness. This is what the aistandard shader should look like (without emissive)

You have the color spaces set correctly for rendering in Maya, but those don’t make a lot of difference for exporting to glTF. The exporter will know what the color space of the file should be based on where the texture is plugged into the shader. But if you are pulling renders in Arnold while setting up your model, you definitely need to make sure your color space is accurate.

The basics for the ORM should be as follows:

  • R is left unwired as this is the channel for AO which is not used in the aiStandard shader. The glTF exporter will understand that the file is an orm based on how the channels are wired and will know to assign the R channel to AO
  • G is wired to specular roughness just as it would be in Arnold. This sets the specular roughness for the material
  • B is wired to metalness in the shader just as it would be for Arnold. This tells the shader if the base color is added to specular reflections as they are in metallic objects.

Basically, we try to stay as close to a working shader in Arnold as possible so that you can render in Maya and still export the same file to glTF. Hope this helps.

@PatrickRyan First of all I’m very grateful for your input and tremendous help.
I followed the aiStandard workflow and your instructions and was able to get my models out looking great with no errors !
Your explanation and screenshot above worked perfectly and that’s what I’ll be using.
For whomever else has this issue here was my workflow. All maps were png in my case. Make sure you set all maps for aiStandard to Raw space and check alpha is luminance. The only exception is the color map which should be left sRGB and uncheck alpha is luminance. Normal map is Raw as well but also uncheck alpha is luminance. This is what worked for me. If anyone sees any errors in my aiStandard workflow feel free to chime in but it looked like it should on my end.
Initially I was trying to plug in the ORM map as shown below which is part of the documentation. I think it should be replaced with @PatrickRyan 's screenshot, as it is more straight foreword and easy to follow. Thanks again for your input!
(I’ll be back with questions Regarding Maya 2020 and animations of a diff thread)

1 Like