Using default options for a gltf export of a 3D model (exported from a Unity project), i have strange rendering in Babylonjs.
Activating or not “Backface culling” in material settings didn’t change anything.
Any idea ?
Thanks
Using default options for a gltf export of a 3D model (exported from a Unity project), i have strange rendering in Babylonjs.
Activating or not “Backface culling” in material settings didn’t change anything.
Any idea ?
Thanks
Hello and welcome
Here the meshes are front facing (not backfacing) but indeed there is a z order issue.
Can you share the file ? (You can share .zip in a post)
Also, I have seen the same problem with three.js in this topic and this topic in both case it came from the fact that GLTF had transparent shaders (blend alpha mode) but opaque apha textures. Maybe you have a look in that direction…
(A try would be :
meshes.forEach(function(mesh){
if(mesh.material){
mesh.material.transparencyMode = 0;
}
})
)
Also, have a look at this topic
It might me a material side orientation issue :
meshes.forEach(function(mesh){
if(mesh.material){
mesh.material.sideOrientation = BABYLON.Material.ClockWiseSideOrientation;
}
})
++
Tricotou
I’ve encountered similar issues when exporting and rendering 3D models, particularly when working with different software environments like Unity and Babylon.js. Here are a few steps and tips that might help resolve the rendering issues you’re experiencing:
SceneLoader.ImportMesh("", "/path_to_your_model/model.gltf", scene, function (newMeshes) {
newMeshes.forEach(function (newMesh) {
newMesh.position = new Vector3(0, 0, 0);
newMesh.scaling = new Vector3(1, 1, 1);
newMesh.material.backFaceCulling = false; // Toggle this to see if it affects your issue
});
});
In my experience with 3D furniture modeling and rendering services, ensuring the compatibility of models and materials across different platforms is crucial. I hope these suggestions help you troubleshoot the problem.
Ok thanks, fixed by Why my GLTF doesn't respect the render depth order - #2 by donmccurdy - Questions - three.js forum