Page 1 of 1

ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material error

Posted: Wed Jan 23, 2013 6:19 am
by ledgarl
hi everyone,
when compiled in 1.7 it looks ok but when compiled inIrrlicht 8 my particles are invisible or missing.

..............
scene::IParticleSystemSceneNode* pas = 0;
vector3df pos = node->getPosition();
pas = game->smgr->addParticleSystemSceneNode(false, 0,-1,pos);


scene::IParticleEmitter* em = pas->createBoxEmitter(core::aabbox3d<f32>(-5,-5,-5,5,5,5),vector3df(0,0.01,0),
60,80, video::SColor(0,140,70,0),video::SColor(0,48,48,48),
1500,1800, 20,core::dimension2d<f32>(10.0f, 10.0f),core::dimension2d<f32>(10.0f, 10.0f));
pas->setEmitter(em);
em->drop();

pas->setMaterialFlag(video::EMF_LIGHTING, false);
pas->setMaterialTexture(0, game->device->getVideoDriver()->getTexture("Textures/f102.bmp"));
pas->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);

scene::ISceneNodeAnimator* anim = game->smgr->createDeleteAnimator(500);
pas->addAnimator(anim);
anim->drop();


................
but when I use the EMT_TRANSPARENT_ADD_COLORmaterial works well
it is really a bug? :?:

thanks

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Posted: Wed Jan 23, 2013 9:05 am
by hybrid
No, you just use a transparancy of 0, which means that the particles are indeed invisible. This was a bug in previous blend mode handling, but particles now work as expected. The code in the examples is also adjusted, so maybe have a look there.

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Posted: Thu Jan 24, 2013 4:39 am
by ledgarl
Hi, thanks for the help
but i look at the examples and did not find an example of EMT_TRANSPARENT_VERTEX_ALPHA particles. In SpecialFx example change this type of material and the same error occurred.

how to change the blend mode handling?
very thanks :)

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Posted: Thu Jan 24, 2013 1:48 pm
by hybrid
Yes, looks indeed that we only have add_blend particles there. Which works better for fade out, though, so maybe you also want this instead of the vertex alpha ones? Anyway, if you enable vertex alpha modes you have to have an alpha value other than 0. So change the first 0 in the SColor statements in the color setup. Just note that this also means that your particles are always rectangles or triangles, which you can fade in or out. Nothing else.

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Posted: Fri Jan 25, 2013 2:57 pm
by ledgarl
Yes, change the SColor, the alpha value of the material particles, and is now visible, but now, as you said, the particles are always rectangles or triangles.
I guess I need another material to find the results I had before.

very much for your time! :)

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Posted: Fri Jan 25, 2013 3:26 pm
by hybrid
Well, vertex alpha works this way. Maybe you want alpha channel, depends on your texture. Or maybe try one_material_blend, as it can also mix different alpha values.