particle emitters
particle emitters
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?
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)
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)
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.
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.
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()?
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()?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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.
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.
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.
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
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.
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.