[FIXED]How do i apply bump map?
[FIXED]How do i apply bump map?
Hey all, i wanted to test bump map but i could not find out how...i searched the forum but did not get much useful topics...Does anyone know how to apply a bump map texture to the model?
Thanks in advance.
Thanks in advance.
Last edited by MasterM on Mon Dec 08, 2008 8:12 pm, edited 1 time in total.
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
I checked the tutorial and if i am not mistaking to make a bump map i need the following code
But i dont notice any difference in the model :S...am i doing something wrong here?
Code: Select all
ISceneNode *sars=smgr->addSphereSceneNode();
ITexture*bumpt=driver->getTexture("textures/sarsbump.jpg");
driver->makeNormalMapTexture(bumpt, 9.0f);
if (sars)
{
sars->setMaterialTexture(0,driver->getTexture("textures/sars.jpg"));
sars->setMaterialTexture(1,bumpt);
sars->setMaterialFlag(video::EMF_LIGHTING,true);
}
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
Hmmm i red the tutorial again and if i am not mistaking bump mapping can only be done to IAnimatedMesh or can it also be done with ISceneNodes?
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
It's not "OR", it's "AND"
See tutorial #11 for mo' info, brotha.
Got to go, see my homies.
Code: Select all
scene::IAnimatedMesh* roomMesh = smgr->getMesh("../models/mymodel.b3d");
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));
room = smgr->addMeshSceneNode(tangentMesh);
Got to go, see my homies.
Thanks guys but i did what the tutorial did and what you guys sayed but it isnt showing the bump map :S...
here is my code
So what am i doing wrong in this code that the bump map doesnt show :S ?
here is my code
Code: Select all
ITexture* colorMap = driver->getTexture("textures/sars.jpg");
ITexture* normalMap = driver->getTexture("textures/sarsbump.jpg");
driver->makeNormalMapTexture(normalMap, 90.0f);
IMeshSceneNode* sar;
IAnimatedMesh* sarsmesh=smgr->getMesh("sars.3ds");
IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
sarsmesh->getMesh(0));
sar = smgr->addMeshSceneNode(tangentMesh);
sar->setMaterialTexture(0, colorMap);
sar->setMaterialTexture(1, normalMap);
sar->getMaterial(0).SpecularColor.set(0,0,0,0);
sar->getMaterial(0).MaterialTypeParam = 5.1f;
tangentMesh->drop();
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
Maybe you want to do like my sample, don't you?
Btw, this sample is about bumpmapping of ISceneNode. Can I also do about IAnimatedSceneNode?
http://www.mediafire.com/?sharekey=16dc ... b9a8902bda
Code: Select all
IAnimatedMesh *bmesh = smgr->getMesh("ground.x");
IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(bmesh->getMesh(0));
ISceneNode *bnode = smgr->addMeshSceneNode(tangentMesh);
bnode->setPosition(vector3df(x,y,z));
bnode->setScale(vector3df(2,1,2));
http://www.mediafire.com/?sharekey=16dc ... b9a8902bda
when i do that the model color changes :S so i letted it out :/What about the material type? Should be changed to EMT_PARALLAX_MAP or something like that.
yes i do but for some reason it just doesnt work for me.Maybe you want to do like my sample, don't you?
the only part i dont have in my code is
but i dont see how it effects the bump mapping and yea pleas do about IAnimatedSceneNode.bnode->setPosition(vector3df(x,y,z));
bnode->setScale(vector3df(2,1,2));
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