Particle2D: SurfaceEmitter

Some demos of the new emitter type “SurfaceEmitter”. The surface emitter has some useful options. You could decide if to emit from transparent areas or not(see the examples below) and best of all, you could set up a grid resolution parameter for the surface. Think about a large photo, there is not enough CPU-power to emit 20.000+ particles per second, so you have the possibility to create a grid of tiles from the surface.

See how you could change the grid.
[as]
myEmitter = new SurfaceEmitter(x, y, surface);
myEmitter.gridResolution = 5;
[/as]
If you have f.e. an image with a resolution of about 100×100 pixel, the emitter will render only 20×20 tiles. And for sure you have all the possibilities with the surface emitter that you have with the other emitter types(gravity, post effects, etc.). For difficult images you could also set the particle-concentration parameter to prevent performance issues. Last but not least, you could choose between color-matching on or off. And for sure, the surface emitter parameters are fully animateable.

This is the PNG-file i have used to emit from.
letter_p.png

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)

Finally, here you can download the updated code base with a quick and dirty class documentation and a test file.

Ps.: I have to give a big credit to the developers of Tweener. It’s a nice and easy-to-use tweening engine. All animations i have done for Particle2D are realized with this nice package.



Particle2D

Update: I have finally improved the automated particle generator. Now it is possible to create a larger amount of particles(i have successfully tried 1000 particles with a average lifetime of 1 sec)

Hio, an information for those which give Particle2D a try. One thing was very bad at the last version, you were limited in how many particles could be generated at the same time. In a first step i created a loop for instanciating more particles at the same time and use the randomize function for keeping it look like a real particle flow. It looks ok for me now, but next step should be to get greater performance out of this(caching the created shapes) and using the velocity-based particle animation for more variety on low particle counts. I think about an automated “timeDivider” value, currently it could be set up threw a public variable on every emitter.

Here is an updated version of the simulator.



Introducing Particle2D

Particle2D logo

Particle2D is a ActionScript 3.0 based particle simulator. I started the development because i need an easy-to-implement and animateable particle system. During the development process for this specific project i decided to give it a try and put some time into writing a basic particle simulator framework. There are already some features included, like PostEffects and GravitySimulation or different types of emitters(OmniEmitter, DirectionalEmitter) but there is a lot of work to do.

Have a look at the Demo here.

For the first release i want to have much more emitter types. I think surface or bitmap-emitters would be great. Also the particle-types should be extended (only shapes available until now).

So, now give us some code.
[as]
myEmitter = new OmniEmitter(this.stage.stageWidth / 2, this.stage.stageHeight / 2);
myEmitter.particlesPerSecond = 1000;
[/as]

This two lines initializes a emitter with default values, if you want to change emitter, particleField or particle parameters you have to initialize several other objects. Have a look on how the post effects are applied.
[as]
var postEffects:ParticlePostEffect = new ParticlePostEffect();
postEffects.addPreset(ParticlePostEffect.BLUR);
postEffects.addPreset(ParticlePostEffect.OUTER_GLOW);
myEmitter.particleField.postProcessing = true;
myEmitter.particleField.postEffects = postEffects;
[/as]

As you can see, the postEffects are applied to the particleField. I have implemented some presets for testing, but you can use every Filter that extends the BitmapFilter class.

Particle2D is designed for being a particle simulator which is animateable and reusable. For this reason there are some limitations you should know. Particle2D is not designed for creating a big amount of particles in a short time. The reason is, that the timer which triggers the particle generating process, depends on the current frame rate. The timer event is f.e. at 33 fps only called 330 times or less in a second. That means that in most cases this will be the maximum number.

Finally, here is a quick and dirty developer preview from Particle2D for download and testing.

I would recommend you to NOT use this in a real project.



Thanks Adobe,

Adobe is going to be my favourite company. After they have bought Macromedia last year, i thought it will never be the same like it was with Macromedia. But unexpectable the ladies and men at Adobe aquisit the “Macromedia way of client communication and support”.

Flex

They have their Adobe Labs, free trials of all the stunning programs for media production and last but not least a lot of special events, remember the Adobe AIR tour or the MAX conference. But what happened last month was the best thing ever done by Adobe or Macromedia.
For Flex Builder, there is a student version for free. This version also includes charting. I have applied for this program and this week, completely incomplex, they have send me an email with the serials. Thanks for this present.

Adobe Flex