This is a quick video demonstrating Tukey Windowing modulating the particle size using age as the input signal. Alpha (from the window function, not rgba) is set to .3 and it's been zoomed in to see the effect easier. Windowing the particle size will help ease transitions from particle birth and death so there's less noticeable pops. Here's some glsl code:
float tukeyWindow(float sig, float alpha) { if (alpha == 0.) // rectangular window return 1.; else if (sig < alpha / 2.) return 0.5 * (1. + cos(2.*3.1459265/alpha * (sig-alpha/2.))); else if (sig > 1.-alpha/2.) return 0.5 * (1. + cos(2.*3.1459265/alpha * (sig-1.+alpha/2.))); else return 1.; }
No comments:
Post a Comment