SolidParticleSystem: Fade out particles over time?

Hi all!

I’d like to make my particles fade out over time. I fiddled with SolidParticle.color.a but cannot see any effect (although sps.computeParticleColor = true).

At best I’d even like to have a texture on the particle. The effect should be ‘vanishing smoke’.

How to?

Thanks for any help,

. J

Adding @jerome our SPS guru

https://doc.babylonjs.com/how_to/solid_particles#colors-and-uvs
If you want to set an alpha value, don’t forget to enable the alpha channel for vertex colors :

SPS.mesh.hasVertexAlpha = true;
1 Like

Mouahahahaahahaah how can I have missed this one :slight_smile: thanks @jerome

1 Like

Here’s an example using a texture and opacity texture (lines 19 and 20) , sps.mesh.hasVertexAlpha set to true (line 94) and uses deltaTime to fade particle (lines 64 - 66, 75 - 77, 10, 104)

https://www.babylonjs-playground.com/#WCDZS#203

Have fun playing and achieving what you want.

2 Likes