Code: Select all
irr::scene::IParticleSystemSceneNode *particleSystem = sceneManager->addParticleSystemSceneNode(true, 0, -1, irr::core::vector3df(0, 0, 0), irr::core::vector3df(0, 0, 0), irr::core::vector3df(1, 1, 1));
irr::scene::IParticleEmitter *emitter = particleSystem->createBoxEmitter(irr::core::aabbox3d<irr::f32>(-0.03f, 0, -0.03f, 0.03f, 0.01f, 0.03f), irr::core::vector3df(0, 0.0001f, 0), 3, 7, irr::video::SColor(0, 0, 0, 0), irr::video::SColor(0, 20, 20, 20), 5000, 6000, 10, irr::core::dimension2df(0.06f, 0.06f), irr::core::dimension2df(0.12f, 0.12f));
particleSystem->setEmitter(emitter);
emitter->drop();
particleSystem->setMaterialTexture(0, driver->getTexture("image.png"));
particleSystem->setMaterialType(irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL);
particleSystem->setMaterialFlag(irr::video::EMF_LIGHTING, false);
irr::scene::IParticleAffector *affector = particleSystem->createFadeOutParticleAffector(irr::video::SColor(0, 0, 0, 0), 7000);
particleSystem->addAffector(affector);
affector->drop();
The problem is that the fade out affector doesn't do anything. I get exactly the same result if I comment the last three lines.
How can I get it to work?