From Irrlicht Engine 1.3 API documentation:
My problem is that when seting material of scene node to EMT_TRANSPARENT_VERTEX_ALPHA and vertex color alpha value to 0 I expect my scene node to disapear. However when lighting is on (by default) there is no change to node appearance. It is solid as before. If I turn lighting off then node appear transparent only partly, even if vertex alpha is 0 which I expect to cause node to disappear completly.EMT_TRANSPARENT_VERTEX_ALPHA Makes the material transparent based on the vertex alpha value.
Here is code I use to set node:
Code: Select all
scene::IAnimatedMesh* testmesh = smgr->getMesh("Media/test.3ds");
scene::IAnimatedMeshSceneNode* test = smgr->addAnimatedMeshSceneNode( testmesh );
//test->setMaterialFlag(video::EMF_LIGHTING, false);
test->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
scene::IMesh* mesh = test->getMesh()->getMesh(0);
for(u32 i=0; i<mesh->getMeshBufferCount(); i++)
{
scene::IMeshBuffer* buffer = mesh->getMeshBuffer(i);
video::S3DVertex* vertex = (video::S3DVertex*)buffer->getVertices();
for(u32 j=0; j<buffer->getVertexCount(); j++)
{
vertex[j].Color = video::SColor(0,255,255,255);
}
}
[Edit:] I have found out that setting vertex color to (0,0,0,0) make node disappear completly (which is not what API reads but OK) however only if I turn lighting off. If lighting is on this material doesnt work at all ...or did I missunderstand something?