mesh.material.flatShading = false;
mesh.mergeVertices(); // ajouter cette ligne si ça ne marche pas sans
mesh.computeVertexNormals();
// mesh.computeFaceNormals();
Il faut d'abord convertir en Geometry, avant de reconvertir en BufferGeometry
const tempGeo = new THREE.Geometry().fromBufferGeometry(child.geometry);
tempGeo.mergeVertices();
tempGeo.computeVertexNormals();
tempGeo.computeFaceNormals();
child.geometry = new THREE.BufferGeometry().fromGeometry(tempGeo);
shoes.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.material.flatShading = false;
const tempGeo = new THREE.Geometry().fromBufferGeometry(child.geometry);
tempGeo.mergeVertices();
tempGeo.computeVertexNormals();
tempGeo.computeFaceNormals();
child.geometry = new THREE.BufferGeometry().fromGeometry(tempGeo);
}
});