particle emitters

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

particle emitters

Post by pin3 »

The tutorial doesn`t explain too well the emitter params. Is there a method I can set the speed at which the particles come out?
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

direction is also speed
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

Post by pin3 »

thanks, that works
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

Post by pin3 »

Is there a way to set two emitters per particle system, or two materials per particle system. I.e I want to imitate fire and smoke and I need a texture for each. I dont want to use two ps per each fire.

Also how do you get smoke, the fire is a yellow texture fading into black. If I want black smoke what texture do I use

(I tried to use a png with EMT_TRANSPARENT_ALPHA_CHANEL but it doesnt work almost at all)
VPB_Enge
Posts: 17
Joined: Wed Jan 02, 2008 11:35 pm

Post by VPB_Enge »

copy/paste from one of my routines:
FireNode.SmokePlums.PlumColor=90;
FireNode.SmokePlums.SmokePlum->setColor(video::SColor(255,FireNode.SmokePlums.PlumColor,
FireNode.SmokePlums.PlumColor,FireNode.SmokePlums.PlumColor));
FireNode.SmokePlums.SmokePlum->setMaterialFlag(video::EMF_LIGHTING, false);
FireNode.SmokePlums.SmokePlum->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
FireNode.SmokePlums.SmokePlum->setMaterialTexture(0, driver->getTexture("../../media/smoke.tga"));
FireNode.SmokePlums.SmokePlum->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);

The tga file has a transparency mask. (masking the surrounding of the plum)
The trick is the smokecolor, the lower, the darker.
Use the fireball example in media and make it gray or something.
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

Post by pin3 »

I'm not going to discuss too much about the code design but it seems that there are redundant calls at times (i.e. when creating particles), making things needlessly complicated

scene::IParticleEmitter* em2 = ps2->createBoxEmitter(...);
ps2->setEmitter(em2); // this grabs the emitter

scene::IParticleAffector* paf2 = ps2->createFadeOutParticleAffector(video::SColor(0,255,255,255));
ps2->addAffector(paf2); // same goes for the affector
why does one need setEmitter() and addAffector()?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply because you need an emitter and you may use affectors. We could also add an emitter via a type parameter in the constructor of the particle system, but that wouldn't allow for different parameters for the emitters. So most people would need to access the emitter afterwards and change the settings. Makes the code just as complicated.
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

Post by pin3 »

Well if you create a scene node with addSceneNode() you dont then later call SceneManager->setNode().
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The emitter is *not* the particle system. It's just the way the particles are emitted. And since this special part of the particle system is highly configurable and can be replaced by many different implementations, it's used as is.
pin3
Posts: 108
Joined: Fri Oct 06, 2006 8:50 pm
Contact:

Post by pin3 »

The emitter is *not* the particle system.
Neither is the node the scene manager.
Can you set as emitter something else then an IParticleEmitter ?
Its a faulty line of thinking IMO.

Anyways I`m using Irrlicht as it is and I have another question.
Is there a way to control the particle billboard rotation? I want the particles to come out as lines perpedicular to the emitter, however they come out horizontaly to the user no matter at which angle the ps is.
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

on the emitter point, if you wanted to, you could code your own particle emitter in your application in order to get a particle system to emit particles however you want it to. Thus, why things are set up the way they are.

As for the orientation of the particles, you will have to edit the particle system node in order to support locking the billboards into a certain orientation.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
Post Reply