ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material error

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material error

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Post 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.
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Post 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 :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Post 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.
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Post 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! :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: ParticleEmitter EMT_TRANSPARENT_VERTEX_ALPHA material er

Post 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.
Post Reply