where alpha!=0. Havent succeeded with this yet.
Current code:
Code: Select all
sceneManager->getParameters()->setAttribute(ALLOW_ZWRITE_ON_TRANSPARENT, true);
ITexture *image = driver->getTexture("../media/leaf.png");
tree.load("tree.md2", sceneManager);
tree.getNode()->setMaterialTexture( 0, image );
tree.getNode()->setMaterialFlag(EMF_LIGHTING, false);
tree.getNode()->setMaterialFlag(EMF_BLEND_OPERATION, true);
tree.getNode()->setMaterialFlag(EMF_ZWRITE_ENABLE, true);
tree.getNode()->setMaterialFlag(EMF_ZBUFFER, true);
tree.getNode()->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
tree.getNode()->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL);