I create 2 boxes with different methed, create box1 in THREE.BoxGeometry(),create box2 in THREE.BufferGeometry(),I gave them the same material,THREE.MeshStandardMaterial.but the final effect presented, they look very different.
The code:
let color=new THREE.Color(1,1,1);
const material = new THREE.MeshStandardMaterial({ color: color,metalness: 1.0,roughness: 0.25 });
let boxgeom = new THREE.BoxGeometry(l, w, w)
box = new THREE.Mesh(boxgeom, material);
const vertices = [
-1, -1, 1, // 0
1, -1, 1, // 1
1, 1, 1, // 2
-1, 1, 1, // 3
-1, -1, -1, // 4
1, -1, -1, // 5
1, 1, -1, // 6
-1, 1, -1 // 7
];
const indices2 = [
0, 1, 2,
2, 3, 0,
5, 4, 7,
7, 6, 5,
4, 0, 3,
3, 7, 4,
1, 5, 6,
6, 2, 1,
3, 2, 6,
6, 7, 3,
4, 5, 1,
1, 0, 4
];
const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3));
geometry.setIndex(new THREE.BufferAttribute(new Uint32Array(indices2), 1));
geometry.computeVertexNormals();
const mesh2 = new THREE.Mesh(geometry, material);
The visual effect is as follows: