I try to do some Per-Pixel Lighting with a mesh and several textures...
but it's REALLY possible ?
with a mesh and one texture :
Code: Select all
video::ITexture* normalMap =
driver->getTexture("../../media/rockwall_height.bmp");
if (normalMap)
driver->makeNormalMapTexture(normalMap, 9.0f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->
createMeshWithTangents(roomMesh->getMesh(0));
room = smgr->addMeshSceneNode(tangentMesh);
room->setMaterialTexture(0,
driver->getTexture("../../media/rockwall.jpg"));
room->setMaterialTexture(1, normalMap);but if our mesh is generated by Sketchup with several texture ? (in dae format)
Like this, we obtain the wrong results...
Code: Select all
video::ITexture* normalMapRockwall =
driver->getTexture("../../media/rockwall_height.bmp");
video::ITexture* normalMapFencing =
driver->getTexture("../../media/fencing_height.bmp");
if (normalMap)
driver->makeNormalMapTexture(normalMapRockwall, 9.0f);
if (normalMapFencing)
driver->makeNormalMapTexture(normalMapFencing, 14.0f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->
createMeshWithTangents(roomMesh->getMesh(0));
room = smgr->addMeshSceneNode(tangentMesh);
room->setMaterialTexture(0,
driver->getTexture("../../media/rockwall.jpg"));
room->setMaterialTexture(1,
driver->getTexture("../../media/fencing.jpg"));
room->setMaterialTexture(2, normalMapRockwall);
room->setMaterialTexture(3, normalMapFencing);
normalMapFencing