Page 1 of 2

New Irrlicht Particle Affectors and Enhancements [BETA 2]

Posted: Mon Jun 09, 2008 9:29 am
by Dark_Kilauea
Updated: June 22, 2008

I'm happy to present several new fancy particle affectors, along with several particle system enhancements. I hope this will be the first of several enhancements I'd like to add to the Irrlicht engine.

First up, a video introducing all the affectors:
http://www.youtube.com/watch?v=-brLc8uUeQk

Alright, now to describe each affector indepth:
  • Collision Response Affector: This affector allows for collision detection per particle at a speed that is actually useful for many effects. It has a bounce coefficient allowing for fine-tuned control over how the particles bounce.
  • Color Morph Affector: This changes the colors of particles based on a user supplied array. It supports any number of colors allowing for very specific effects.
  • Random Direction Affector: This affector adds a random direction to particles allowing for effects like wind turbulence to be achieved. It has several controls to fine-tune the effect.
  • Scale Affector: This changes the size of individual particles, allowing for effects like smoke to expand over time. Requires my custom particle enhancements to work!
  • Spline Affector: This affector simulates a spline that pulls individual particles along a path. Very powerful.
Ok, now to the particle system enhancements. In order to get the scale affector to work, I was forced to extend the functionality of the particle system itself. The changes allow for each particle to have it's own size and also store a small 8-bit user variable to allow affectors to remember particle's that have passed a condition. These changes are 100% backwards compatible with the old particle system interface. See below to get them.

Now, as I know some people won't look at this seriously unless they've seen a screeny, here you go:
Image
Can your version of irrlicht do that? Didn't think so :)

Final Note:
Please, please, please post bug reports or optimizations for these affectors or modifications. I'd like these to be as helpful as possible. Otherwise, feel free to leave any comments or other suggestions.

Thanks.

[Download Center]
Win32 Demos: http://kilauea.zxq.net/Downloads/DKNewI ... -demos.zip
Minimal Package: http://kilauea.zxq.net/Downloads/DKNewI ... inimal.zip
Full Package: http://kilauea.zxq.net/Downloads/DKNewI ... s-full.zip

Posted: Mon Jun 09, 2008 4:20 pm
by doqkhanh
:shock: very cool video, and thanks for sharing your modified code.

Very very useful.

Posted: Mon Jun 09, 2008 6:10 pm
by d3jake
Very nice! Though it runs slow on my computer, but that's prolly due to me having extra things running in the background.

Posted: Tue Jun 10, 2008 2:35 am
by wyrmmage
very cool! I especially loved the flamethrower demo 8)

Posted: Tue Jun 10, 2008 7:23 am
by Dark_Kilauea
Thanks for the kind words. :)

Perhaps someone can look at my code and see if there is a way to do things better than I have? Are there any other affectors or features to the existing affectors that people would like to see?

Posted: Tue Jun 10, 2008 7:53 am
by hybrid
I'll have a look, and what about submitting these extensions to the irrExt project? That's exactly the kind of things that should be developed there. Ask Zeussy or bitplane to join the project and maintain your extensions with easy access for the community.

First thing I found: Put the elements into the proper namespaces and only include the necessary stuff, not irrlicht.h.

Posted: Mon Jun 16, 2008 10:18 pm
by Dark_Kilauea
I am still working on this. Things came up and stole my time atm.

Posted: Tue Jun 17, 2008 1:00 am
by sudi
Hmmm i remember i commited my scale affector but it never got integrated...to bad maybe its done this time and hopefully released in a resonable time together with a new irrlicht version.

Posted: Tue Jun 17, 2008 7:24 am
by JP
Nice work! The flamethrower looks pretty cool, maybe we can make Team Fortress 2 in Irrlicht, gotta love the pyro xD

Posted: Tue Jun 17, 2008 8:48 pm
by Darktib
Looks very good!

Very good job!

Posted: Thu Jun 19, 2008 8:45 am
by maves
goooooood job !!! but.. there is always a 'but' ....

i couldnt compile your ScaleAffector example..

startSize is not member of irr::scene::SParticle ..

startSize dont exist in IrrLicht docs..

have you forgotten something?

mmmh how can i manage your diff file on windows !?

Posted: Fri Jun 20, 2008 4:48 am
by Dark_Kilauea
The Scale Affector will only work if you apply my patch to your copy of irrlicht and recompile the library. startSize and size are things I added to SParticle to allow for scale changes on individual particles.

I'm working on making it easier to use my affectors with irrlicht soon. I'll release updated files that people can just unzip into their 1.4.1 irrlicht copy and go from there, as well as integrating the affectors straight into the library.

Posted: Fri Jun 20, 2008 6:07 am
by dlangdev
hey, thanks for the demo, looks really cool.

Posted: Mon Jun 23, 2008 1:19 am
by Dark_Kilauea
[Update June 22, 08]
The project has been split into 2 packages. You can get either the full package, which features full integration into the irrlicht library, or the minimal package, which contains only what you need to use the scale affector.

The full package allows you to add one of my custom affectors with createFoo() functions built straight into the particle system scene node.
For example:

Code: Select all

 ps->createScaleAffector( core::vector2df(20,20) ); 
The minimal package will require you to add the affectors the old way.

GetFoo() and SetFoo() functions have been added to all the affectors. Several minor bug fixes and optimizations have been added as well. The documentation has also been improved, both for the affectors and the demos. I also made the affectors conform to irrlicht's namespaces, meaning that you will have to add scene:: or using namespace scene; in order to use the affectors. However, I made the headers include safe, meaning you can include them as many times as you need.

Keep in mind that the affectors in the minimal package are under a license very similar to the irrlicht one now. Please read the readme file for details. I don't foresee any problems. ;)

You can grab the new files in the first post, under the "Download Center"

Posted: Mon Jun 23, 2008 6:37 am
by piiichan
Are there any other affectors or features to the existing affectors that people would like to see?
Lately, I had a need for a fade in affector :roll: I think it would be easy for you (Dark_Kilauea) to implement. :)