Flint Particle System Forum - Performance - Particles Sun, 11 Dec 2011 17:36:08 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Performance - Particles http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1482#Comment_1482 http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1482#Comment_1482 Thu, 16 Dec 2010 22:28:21 +0000 ven
var emitter:Emitter2D = new Emitter2D();
emitter.counter = new Blast( 50 );
emitter.addInitializer( new SharedImage( new Line( 1 ) ) );
emitter.addInitializer( new ColorInit( colorMin, colorMax ) );
emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 100, 100 ) ) );
emitter.addInitializer( new Lifetime( 0.2, 0.4 ) );

emitter.addAction( new Age() );
emitter.addAction( new Move() );
emitter.addAction( new RotateToDirection() );

I create only one renderer, initialized as:

renderer = new BitmapRenderer( new Rectangle( 0, 0, stageWidth, stageHeight ) );
renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.95,0 ] ) );
addChild( renderer );

In reading an old post it was recommend to keep the rectangle area small when using BitmapRenderer. Currently, my BitmapRenderer is set to the entire stage to cover 3-8 emitters for the single renderer than can be generated.

Is it advisable to keep one emitter per renderer and reduce the area size to cover only that explosion? If so, what would be the best way to removed the renderer after the explosion has completed. Should I attach a listener to renderer and then remove itself. I'm asking before I go rip up a bunch of code.... Thanks.

-ven ]]>
Performance - Particles http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1487#Comment_1487 http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1487#Comment_1487 Mon, 20 Dec 2010 08:01:33 +0000 Richard
emitter.addEventListener( EmitterEvent.EMITTER_EMPTY, cleanUp );

function cleanUp( event:EmitterEvent ):void
{
emitter.stop();
renderer.removeEmitter( emitter );
removeChild( renderer );
renderer = null;
emitter = null;
}
]]>
Performance - Particles http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1489#Comment_1489 http://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1489#Comment_1489 Tue, 21 Dec 2010 07:49:59 +0000 ven