[FIXED]How do i apply bump map?
-
- Posts: 53
- Joined: Sun Aug 31, 2008 3:16 pm
- Location: Split, Croatia
I think you mean tutorial 8...i checked it but found nothing on bump mapping :S...if anyone know my problem pleas tell me...i am really lost :/
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Life of a programmer == Const abuse
for some reason when i use the following code i get the followong results :
but the model itself isnt that color...
I really dont know whats the problem but i tihnk it has to do with the tangets...if someone know the problem pleas help me .
and i get the following results :int main(int argc, char** argv)
{
IrrlichtDevice *device =
createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 32,
false, false, false, 0);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
scene::IAnimatedMesh* sarMesh = smgr->getMesh("sars.3ds");
scene::ISceneNode* room = 0;
IMeshSceneNode* sars;
if (sarMesh)
{
smgr->getMeshManipulator()->makePlanarTextureMapping(
sarMesh->getMesh(0), 0.003f);
ITexture* colorMap = driver->getTexture("textures/sars.jpg");
ITexture* normalMap = driver->getTexture("textures/sarsbump.jpg");
driver->makeNormalMapTexture(normalMap, 9.0f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
sarMesh->getMesh(0));
sars = smgr->addMeshSceneNode(tangentMesh);
sars->setMaterialTexture(0, colorMap);
sars->setMaterialTexture(1, normalMap);
sars->getMaterial(0).SpecularColor.set(0,0,0,0);
sars->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
sars->getMaterial(0).MaterialTypeParam = 0.035f;
sars->setMaterialFlag(EMF_LIGHTING,true);
tangentMesh->drop();
}
ISceneNode* lit=smgr->addLightSceneNode(0,vector3df(90,90,90), video::SColorf(255.0f,255.0f,225.0f));
smgr->addCameraSceneNodeFPS();
while(device->run())
{
sars->setRotation(vector3df(0.05,0.05,0)+sars->getRotation());
driver->beginScene(true, true, SColor(0,200,200,200));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
but the model itself isnt that color...
I really dont know whats the problem but i tihnk it has to do with the tangets...if someone know the problem pleas help me .
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Life of a programmer == Const abuse
can you take out the line...
also if sarsbump is already a bump map (and not a heightmap) then take out the line...
Code: Select all
smgr->getMeshManipulator()->makePlanarTextureMapping(
sarMesh->getMesh(0), 0.003f);
Code: Select all
driver->makeNormalMapTexture(normalMap, 9.0f);