I’ve set all of the options for transparency and opacity in the renderer, scene, and my texture. I’m slowly reducing each point’s opacity but the appearance is unaffected.
const opacities = this.particleSystem.geometry.attributes.opacity.array;
if (Date.now() > this.duration) {
this.fadingOut = true;
}
if (this.fadingOut) {
const fadeSpeed = 0.005;
let allFadedOut = true;
for (let i = 0; i < this.particleCount; i++) {
opacities[i] -= fadeSpeed;
if (opacities[i] > 0) {
allFadedOut = false;
} else {
opacities[i] = 0;
}
}
this.particleSystem.geometry.attributes.opacity.needsUpdate = true;
if (allFadedOut) {
this.stop();
return;
}
}
That’s the extent of my setup for using the PointsMaterial and gradually reducing particle opacity. I’ve set transparent on everything I could find. I thought maybe there was a trick I was missing.But no, no libraries, just updating positions in the animate loop.
Ahh i see. ok then you don’t need to make those other arrays as attributes.
Only the color array is really observed by the shader.
Just make them arrays and use them as you are now.
You only need them as attributes if you are doing your animation inside the shader.
For color… look at how this example sets up the color attributes:
For per particle transparency, I think you can use Vector4 instead of Vector3 for the color and get alpha that way.
Thank you for your replies, I appreciate your help. I’ve decided to just remove them in a random pattern at the end of their animation for a different kind of fade-out effect.