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!
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.
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.
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.
@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.
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.