For material setup, use emissive texture with color tint, and by changing that color towards black, you can change its fading. Make sure you don’t recreate pc.Color
on each update
, but have one for each meshInstance pre-created.
In order to fade any specific mesh rather whole material, use this method:
var fade = 0.5;
color.set(fade, fade, fade);
meshInstance.setParameter('material_emissive', color.data);