Game Development Community

particleEmitterNode and particle fading question

by Shane McLeod · in Torque Game Engine · 08/22/2002 (1:43 pm) · 2 replies

I'm having a hell of a time figuring out how to fade a particle. I know I know, simple, but I just can't find any information.

I've looked at Desmonds great tuts with the campfire example. But I want each "flame" to fade into another for a smoother fire.

For instance, each particle begins to fade at 75% of its lifetime. At about 50% of the lifetime, the next particle is emitted in a location just off from the previous one, within bounds.

What I get now is strobing which is just not convincing at all.

I can see the footprints, footpuffs, etc fading in the game so I know it can be done.

#1
08/22/2002 (2:34 pm)
There's a link in resources to a particle editor. You'll find that to be very helpful...

Otherwise, make sure your 'times[]' are pretty equal (from 0 to 1, sequential) and then set the alpha (4th number of the colors[]) to what you want... like
times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0
   
   colors[0]     = "1.0 1.0 1.0 1.0";    // full alpha
   colors[1]     = "1.0 1.0 1.0.0 0.50"; // half alpha
   colors[2]     = "1.0 1.0 1.0 0.0";    // no alpha

If the times are off, like if 'times[1]=0.9' then it will slowly fade from full to half, then very fade to none (in this example).

Other ideas? Could be your offset isn't zero--this would keep it from spawning the particles in the same spot, or the wind isn't zero, gravity, etc.. you get the picture. :) Most likely it's the times/colors, IMHO.

edit: had the "half alpha" set at 0.75. oops!
#2
08/22/2002 (3:18 pm)
Eric, you are the MAN! Thanks.