3ds max exporter: material issues on glb

Dear community
I am using the nice babylon exporter to export models from 3ds max to gltf. Recently, I exported a new model that seems to have issues with the material on the wing, see:

Any ideas why this is happening? The files to reproduce this behavior can be found here:
acft_mdl.zip (4.9 MB)

I already (somewhat prematurely) opened an issue on github (see here), but maybe someone in this forum can come up with another explanation. Thank you very much!

cc @Guillaume_Pelletier

and @bghgary :wink:

Hi,
It’s appear that for any reason, the exporter is save a Color channel for the vertices. This one is in cause here.
image
Just disable the use vertex color into the babylon viewer made the trick.


However i have to understand why these vertex colors are exported. Did you done it intentionaly ??
Have you tried to export the model with Max2021, in order to see if something change into the 2023 API?
G.

2 Likes

I’m just guessing, but one possibility is that Max ignores vertex colors when there is a material (which is fairly common for engines and tools, e.g., Unity). Babylon.js and glTF multiplies the vertex colors with the material colors. If Max ignores the vertex colors when there is a material, then the exporter should take that into consideration and not output vertex colors when there is a material.

3 Likes

Sorry for the late reply…and thx a lot for the hints and insights!

  • @Guillaume_Pelletier I deleted the vertex color channel with Tools->Channel Info->cleared the vc map
    => This worked!
  • @bghgary interesting guesstimate: Is there a way to verify that?

Unfortunately, I don’t have access to a max version 2021.

PS: So the “Invalid rank passed to CreateTreeNode” warning seems unrelated to this, right? Any idea where that warning could come from?

I don’t know Max, but if you add vertex colors to the mesh (and maybe set them to black or something) and the material also has colors, you should be able to check if the vertex colors are ignored.

Thx for the hint @bghgary.
The following test sample should hopefully shed some light on the issue:

If you want to experiment yourself with the files, here they are:
test_file_wing.zip (1.9 MB)

Curious to hear your opinion.

What color is the vertex color you are using? Is the vertex color reflected in the max scene for 4?

Thx for the input.
I tried to assign wings 3 and 4 a new vertex color (red), see screenshot:

  • it works for the wing that had its vertex color channel cleared (4)
  • it does not work for the original version (3)

This, this issue might also be within max, no? I also tried to set radiosity to zero…no impact.
Any other suggestions? Thx a lot!

The file: CL650_test.zip (386.4 KB)

@PatrickRyan Can you help with this? The main question I’m trying to figure out is if material colors will override vertex colors in Max.

1 Like

@bghgary, if I understand you question correctly, you want to know if a texture will override vertex color on a mesh. As far as I can tell, no… Max acts just like Babylon does in that texture and vertex color are multiplied together. This is a pink vertex color used with our standard UV map texture:

I don’t see a way in the exporter or the Babylon material properties to include/ignore vertex color in export to glTF. Basically, the render in Max mirrors what we see in Babylon (though our render is lit differently, so the pink looks lighter here:

The only way we don’t multiply vertex color and texture is if we assign a texture to emissive color. This is the scene environment intensity set to 0 and the UV map placed in the emissive texture input with emissive color set to white. I wouldn’t expect vertex color to have any impact here so this aligns with what should happen.

Let me know if I missed anything you need to know.

1 Like

Is this for Max or Babylon?

This part is for Babylon

1 Like

Ok, well, I don’t know then. @tkazik It seems you might be doing something uncommon with the materials. The exporter doesn’t handle every single case. If you can simplify what is happening with the material, it will probably export better. Or better yet, use the new glTF material that Autodesk added recently.

1 Like