[FIXED]How do i apply bump map?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

pleas help me with this guys...
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
happilylazy
Posts: 53
Joined: Sun Aug 31, 2008 3:16 pm
Location: Split, Croatia

Post by happilylazy »

One of the beginning tutorial (one with the small dwarf in the small room) has textures added to the walls, you can choose if you want bump or parlax mapping, so check it out.
What now??? =_=''
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, example 11. It's using the same room, but a sphere instead of the dwarf...
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

for some reason when i use the following code i get the followong 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;
}
and i get the following results :Image

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
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

can you take out the line...

Code: Select all

smgr->getMeshManipulator()->makePlanarTextureMapping( 
sarMesh->getMesh(0), 0.003f); 
also if sarsbump is already a bump map (and not a heightmap) then take out the line...

Code: Select all

driver->makeNormalMapTexture(normalMap, 9.0f); 
Image
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Thank you and what does the line does that effects the color?
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
Post Reply