hi
continuing this
post
i think i got it.
i did this before:
Code: Select all
for (u32 i = 0; i < body[part]->getMaterialCount(); i++)
{
body[part]->getMaterial(i).setTexture(1, driver->getTexture("data\\effects\\cel.png"));
body[part]->getMaterial(i).TextureLayer[1].BilinearFilter = false;
body[part]->setMaterialFlag(EMF_LIGHTING, false);
if (celMat != -1)
body[part]->getMaterial(i).MaterialType = (E_MATERIAL_TYPE)celMat;
}
to make sure that every meshbuffer gets the toon shade. it worked, but not when celMat's materialtype is EMT_TRANSPARENT_ALPHA_CHANNEL
so, thats when i made celMat without transparency, and celMatAlpha with alpha channel transparency
Code: Select all
for (u32 i = 0; i < body[part]->getMaterialCount(); i++)
{
body[part]->getMaterial(i).setTexture(1, driver->getTexture("data\\effects\\cel.png"));
body[part]->getMaterial(i).TextureLayer[1].BilinearFilter = false;
body[part]->setMaterialFlag(EMF_LIGHTING, false);
if (celMat != -1)
body[part]->getMaterial(i).MaterialType = (E_MATERIAL_TYPE)celMat;
}
if (celMatAlpha != -1)
body[part]->getMaterial(0).MaterialType = (E_MATERIAL_TYPE)celMatAlpha;
only the first meshbuffer gets the alpha channel transparency, and the others are solid.
it works for me, even if the first meshbuffer doesnt have transparent texture, but the others do.
maybe the problem was that all of them had transparency?