I am exploring ways to enhance a mesh by adding multiple materials. My goal is to layer a slightly transparent material on top of the existing one, allowing for opacity animation between the two. However, when I try to pass them as an array, the mesh simply disappears. There must be something crucial that I am overlooking here. The ultimate objective is to smoothly animate the opacity transition of the new material over the original.
Original Material
const originalMaterial = child.material.clone();
New Material
const newMaterial = new THREE.MeshStandardMaterial({
name: 'New Mat',
map: newTexture,
emissiveMap: newTextureMap,
side: THREE.DoubleSide,
opacity: .5,
transparent: true
});
Combining them
child.material = [originalMaterial, newMaterial]
child.material.needsUpdate = true