I have problem during model loading from obj. I'm using Irrlicht 1.8.
I have tree model, which has leaves created on polygons with textures (TGA). Problem is that around leaves i have white or black 'halo'.
Here is my code:
Code: Select all
scene::IMesh *mesh = m_device->getSceneManager()->getMesh( (m_repoDir + "/" + object.getDirectory() + object.getFileName()).toStdString().c_str());
if (mesh != NULL)
{
m_node = m_device->getSceneManager()->addOctreeSceneNode(mesh);
if (m_node != NULL)
{
m_node->setPosition(core::vector3df(m_projectElement->getX(), m_projectElement->getY(), m_projectElement->getZ()));
m_node->setMaterialFlag(video::EMF_GOURAUD_SHADING, true);
m_node->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, true);
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
m_node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
m_node->getMaterial(0).Shininess = 50.0f;
m_node->getMaterial(0).EmissiveColor.set(0,200,200,200);
m_node->getMaterial(0).DiffuseColor.set(0,200,200,200);
m_node->getMaterial(0).AmbientColor.set(0,200,200,200);
m_node->setScale(core::vector3df(100, 100, 100));
}
}
Code: Select all
SIrrlichtCreationParameters params;
params.Fullscreen = false;
params.WindowSize = core::dimension2d<u32>(1024, 768);
params.Stencilbuffer = true;
params.AntiAlias = true;
params.LoggingLevel = ELL_INFORMATION;
params.WithAlphaChannel = true;
params.Doublebuffer = true;
params.DriverType = video::EDT_DIRECT3D9;
params.Stereobuffer = false;
params.WindowId = widget->winId();
Code: Select all
getDriver()->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
getDriver()->setTextureCreationFlag(video::ETCF_OPTIMIZED_FOR_QUALITY,true);
getDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
I don't know what's going wrong. Please help me find error or suggest where I should search for errors.
Thanks.