3ds Max Physical Material -> Blend -> z-fighting


I’m using the 3ds Max exporter to export a scene, which has two objects close to each other, which use Physical Material with Blend as the Transparency mode.

However, when I view the scene, z-fighting occurs when I turn the camera. I assume this is because the mesh/pivot of the object in the background is getting closer to the camera as it turns, thus rendering it in front of the object in front of it. Attached are some screenshots to illustrate.
I tried setting zOffset for the material in front, but not much is changing.

How can I force a material to always be in front of the other?

Thanks in advance

Yes I think you found the cause
You can play with zOffset: Material | Babylon.js Documentation (babylonjs.com)

Thanks, I’ve been looking into that, but changing the zOffset value doesn’t change anything in the viewer.
When loading the Gltf model, I loop over the meshes[0] children, check for the material name and change that zOfffset. Which indeed changes the value for that material, but the z-fighting remains.

Screenshot 2024-04-20 152515

Any idea what I’m doing wrong?

I also tried re-creating my scene and materials in Blender, with the same result.

Can you share a repro in the playground ?