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.