I tried doing it with emissive color of mesh, and I was storing the previous color in mesh UserData so After highlight I can return to original value.
This is How I am doing right now using Gsap.
private highlightMesh = (mesh) => {
mesh.userData.emissive = mesh.material.emissive;
mesh.userData.emissiveIntensity = mesh.material.emissiveIntensity;
const t1 = gsap.timeline({
onComplete: () => {},
onUpdate: () => {},
});
t1.to(mesh.material.emissive, {
r: 1.0,
g: 0.0,
b: 0.0,
duration: 0.1,
})
.to(mesh.material, {
emissiveIntensity: 1.0,
})
.to(mesh.material.emissive, {
r: mesh.userData.emissive.r ? mesh.userData.emissive.r : 0,
g: mesh.userData.emissive.g ? mesh.userData.emissive.g : 0,
b: mesh.userData.emissive.b ? mesh.userData.emissive.b : 0,
duration: 0.1,
})
.to(mesh.material, {
emissiveIntensity: mesh.userData.emissiveIntensity,
});
};
The issue is, it works good on PC but on Mobile it retains the highlight color as shown below
original Mesh
after selection and performing the highlight
It does not happen in this vans shoe website and I don’t think they are even doing with emissive color they are doing most probably the color.
thankyou,
Seeon