« Return to Thread: Dynamic effects on a material

Re: Dynamic effects on a material

by 13Flo :: Rate this Message:

Reply to Author | View in Thread

Hi,

Maybe because you're executing updateEffects on your onEnterFrame loop no ? :)
In fact you see just the blur filter 100,100,2





Gibbah wrote:
Hi,

Im adding blurr to a material like this:

fx = new EffectLayer();
viewport.addRenderLayer(fx);
fx.addEffect(new LayerEffect(new BlurFilter(100, 0, 2)));
material1.renderLayer = fx;

This works with no problem. The material1 gets blurred nice and good.
Then onEnterFrame I would like to update this blurr with new values something like this:

function updateEffects(object,blurAmount):void {
    fx = null;
    fx = new EffectLayer();
    fx.addEffect(new LayerEffect(new BlurFilter(blurAmount, blurAmount, 2)));
    object.renderLayer = fx;
}
function onEnterFrame( e:Event ):void {
    updateEffects(material1,100,)
    renderer.renderScene( scene, camera, viewport );
}

But no matter what I do in the uppdateEffects-function I don't get it to work. As soon as I call updateEffects there are no blurr at all on the material.

How can I update the blurr-filter dynamicly?

Any help is very appreciated!

/Gibbah

 « Return to Thread: Dynamic effects on a material