I’ve been struggling when changing the material on a GLTF-imported mesh. I couldn’t get my test scene to work in the playground, so I posted it at http://durrantlab.bio.pitt.edu/tmp/babylon_gltf_test/ instead.
The object initially displays without any problems, just like it appeared in Blender (using vertex colors). Wait 5 seconds, and my code replaces the GLTF-imported material on the mesh with a StandardMaterial. My thinking in doing this is that I’d like to use baked shadows, though that’s not relevant to this test scene. It’s great that babylonjs still respects the vertex colors, even though the material has changed. But these’s a problem. The object now looks like this:
Notice the numbs that appear where the cylinders intersect. This is because portions of the mesh that should be occluded (on the inside of the mesh) are showing through the surface. I haven’t for the life of me been able to figure out how to fix this problem.
Thanks for your help.