Hello,
I have managed to load a 3d environment using my3d format in Irrlicht.
I created a window in the 3d model, so in 3D Studio I set the glass material opacity to 30%, and in Irrlicht it appears transparent, but depending on the angle, the color changes slightly as you can see in this screenshot:
http://i22.photobucket.com/albums/b339/ ... window.jpg
I've trying to fix it but after some hours I'm at the same point, can anyone tell me what I'm doing wrong?
In the same scene I created a fire using the same code (copy/paste) from the SpecialFX tutorial, but depending on the angle it sometimes appears black as can be seen on this screenshot:
http://i22.photobucket.com/albums/b339/Amt0571/fire.jpg
I'm sure that it's not my graphics card, since I tested it on two computers with different cards. By the way, I'm using OpenGL.
Thanks in advance
[SOLVED] Transparency and fire
[SOLVED] Transparency and fire
Last edited by Amt0571 on Wed Mar 08, 2006 6:25 pm, edited 2 times in total.
eh the first got a sky.. the scond does not!the color changes slightly as you can see in this screenshot:
thats more than slightly!
if u look at the egde of the windowf rame , then the colors are actually very close in both img.
It is the part where the sky 'blend in' that are different
..perhaps the no-sky img is taken just outside the far-distance for the scene??
does the skybox disapear in some posisteion in ur game?
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
neh.. when i cranked my light on my monitor up to 90% i could see a blueish color on the 'black'...
so.. both -are- the same but apear so different..
I have NO idea why
sorry :(
so.. both -are- the same but apear so different..
I have NO idea why
sorry :(
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Hi
For window: have you tried to set the material flag EMF_LIGHTING off?
For Fire: Maybe you lost the texture: try to control it using an ITexture pointer and chack in every loop: maybe something goes wrong.
For Fire: Maybe you lost the texture: try to control it using an ITexture pointer and chack in every loop: maybe something goes wrong.
"We work in the dark, we do what we can, we give what we have, Our doubt is our passion and our passion is our task. The rest: is art of Madness" (H.James)
Ok, I found the window problem is somehow related to the particle system (the fire).
The code I'm using for the fire is exactly the same used in the SpecialFX tutorial. I found that the problem is related to this line:
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
If I delete or comment this line, the window appears fine, but the fire appears without transparency. On the other hand, if I use this line, the fire is ok, but I have the window problem...
The whole code for the particle system is this one:
scene::IParticleSystemSceneNode* ps = 0;
ps = smgr->addParticleSystemSceneNode(false);
ps->setPosition(core::vector3df(2996,295,-524));
ps->setScale(core::vector3df(2,2,2));
ps->setParticleSize(core::dimension2d<f32>(20.0f, 20.0f));
scene::IParticleEmitter* em = ps->createBoxEmitter(
core::aabbox3d<f32>(-7,0,-7,7,1,7),
core::vector3df(0.0f,0.06f,0.0f),
80,100,
video::SColor(0,255,255,255), video::SColor(0,255,255,255),
800,2000);
ps->setEmitter(em);
em->drop();
scene::IParticleAffector* paf =
ps->createFadeOutParticleAffector();
ps->addAffector(paf);
paf->drop();
ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0, driver->getTexture("./data/fire.bmp"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
Thanks again
The code I'm using for the fire is exactly the same used in the SpecialFX tutorial. I found that the problem is related to this line:
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
If I delete or comment this line, the window appears fine, but the fire appears without transparency. On the other hand, if I use this line, the fire is ok, but I have the window problem...
The whole code for the particle system is this one:
scene::IParticleSystemSceneNode* ps = 0;
ps = smgr->addParticleSystemSceneNode(false);
ps->setPosition(core::vector3df(2996,295,-524));
ps->setScale(core::vector3df(2,2,2));
ps->setParticleSize(core::dimension2d<f32>(20.0f, 20.0f));
scene::IParticleEmitter* em = ps->createBoxEmitter(
core::aabbox3d<f32>(-7,0,-7,7,1,7),
core::vector3df(0.0f,0.06f,0.0f),
80,100,
video::SColor(0,255,255,255), video::SColor(0,255,255,255),
800,2000);
ps->setEmitter(em);
em->drop();
scene::IParticleAffector* paf =
ps->createFadeOutParticleAffector();
ps->addAffector(paf);
paf->drop();
ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0, driver->getTexture("./data/fire.bmp"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
Thanks again