Hi. I'm trying to make a gradual blur effect using one of Moghunter's plugin:
MOG_PixiFilters.js
With this plugin, the blur filter happens instantly. What I want to do is make the blur effect gradually stronger over time. What I had in mind is to use linear interpolation or lerp, where the formula is newValue = value + (maxValue - value)*t, and 0<t<1.
I opened the plugin's JS file, and tried to change line 327 into this:
Code:
if (filter_id === 0) { // BLUR
for (i = 0; i <= 800; i++) {
var x = [0];
x = x[i-1] + 0.01 * (8-x[i-1]);
return new PIXI.filters.BlurFilter(x);
}
What I'm trying to do here is I want the BlurFilter strength to go from 0 to 8 gradually, with t=0.01.
However, it doesn't work. I tried some other ways as well but to no avail. I admit that my JS is very very rusty, so I'd appreciate if any experts out there can lend some helping hand