Particle Animator Transparency Functions

I’m currently doing a project where I need to create light trails using particles.

I’d like the trail to fade off over the course of it’s lifetime.

I remember the particle animator function: transparency=lifetimeI

…but this doesn’t give a very satisfying fade off. The trail looks pretty constantly bright and then the fade at the end is quite abrupt.

Does anybody know a different function to give me a much slower fade so the trail gets darker earlier in it’s lifetime but hangs around for the same time?

Thanks

Here are a few functions that have been shared in the community over the last 25 years:

Transparency Functions

simple-fade-off (evenly from start)

transparency = lifetimeI

simple-fade-up (evenly from start)

transparency = (1-lifetimeI)

approx-fade-off

transparency = sin(lifetimeI)

normal-fade-off (over life)

transparency =sin(lifetimeI*1.5)

normal-fade-up

transparency = cos(lifetimeI*1.5)

fade-in-out (over life)

transparency = sin(lifetimeI*3.14)

fade-in-out+cnt

transparency = power * ( sin( lifetimeI * 3.14 ) )

This is better than transparency = lifetimeI because with the previous formula you would have particles ‘pop’ on and then fade. I had some popping occur when I was trying to make smoke from a chimney, but it gave this interesting puffing effect.

fade-midway+cnt

transparency = transparency / sin(lifetimeI) * power

fade down in the middle of the particles life, with power control (power is between 0 and 1) (control with power)

fade-up-off-fast

transparency = -0.05(pow(tan((lifetimeI-0.5)/0.37, 2)) +1

Produces a very steep up flat top , very steep down curve, no explict control.

fade-up-out+cnt2 (use magnitude>1)

transparency = -(magnitude*lifetimeI) (lifetimeI - 1)

trans-near-a-point

transparency = 1 - smoothstep(100,400, length(pos-(100,0,500))))

In this case only near coordinates 100,0,500 - the old light default location, 100 and 400 define the distances close and far - that limit the transparency. I used this when I wanted rain to light up around a street light, - unlike a matte it works in 3 space, like a ball - when the rain enters the ball it lights up- very nice

fade-off+cnt

transparency=pow(lifetimeI,magnitude)

fade-up-off-random

transparency = sin(lifetimeI + turbulence(pos,1))

A great function that acts more naturally in fading off particles

linear-fade-up-off+cnt

transparency = ( ((1-lifetimeI)<power)*smoothstep(0,1,(1-lifetimeI)/power)) + (((1-lifetimeI)>=power)*smoothstep(0,1,lifetimeI/(1-damping)) )

This amazing function allows you to move the mid point of the fadeup/off and effect the out (via damping) try damping = 25% and power =0.5

linear-fade-up-off+cnt2

transparency = (((1-lifetimeI)<power)*(1-lifetimeI)/power) + (((1-lifetimeI)>=power)*lifetimeI/(1-damping))

fade up to frame set by power -fade down from frame set by damping (don’t use damping values lower than power) -change damping to power if you want it to fade up and down immediately. Try power=0.25, damping=75

hold-then-off

transparency = (lifetimeI>0.5)*lifetimeI + (lifetimeI<=0.5)*0.5

(lifetimeI>0.5) returns 1 when lifetimeI is greater than 0.5 and zero when lifetimeI is less than 0.5
and likewise (lifetimeI<=0.5) returns 1 when lifetimeI is less than or equal to 0.5 and zero when lifetimeI is greater than 0.5 thus multiplying the then and else functions by their respective conditional expressions and adding them together results in transparency fading down to 0.5 until halfway through the particles life and then remaining at 0.5 till the end…

9 Likes

Hey @leovfx here is one idea youu can try

transparency = lifetimeI x power

This will allow you to adjust the fade effect interactively while you drag the power value in the GUI

Here is the particle functions from fxguide… with some of my modified versions…

particle_functions.zip (12.7 KB)

2 Likes

Amazing list. Thanks so much

Wow! All time classics!

1 Like