Hi, I have a few question ralated to normal map, I hope you can help me
1- This works as normal map
2- If I use some program to make it black and white, still works?
3- I want use normal map in the model of a house, but I don't know how, I wanna make the textures in Blender, should I set the normal map texture in blender itself and then use the code in Irrlicht? in the example 11 the model only use 1 set of textures in the whole model but a house need a lot of textures, Should I make the rooms of the house manually?, I mean make first the floor, then the walls, etc. diferent models in diferent nodes
Well, thanks for you time, thanks
Normal map questions
Well if you want to have different textures with custom materials (irrlitch's parallax, a shader etc) you should do something like this:
That looks for all the materials in the model until it finds a material using the texture you specified on Diffuse. Once found you just change the material type to what you desire ( in this case a normal map shader).
________
Toyota A Transmission History
Code: Select all
stringc Diffuse, Normal; // Diffuse being the name of the texture in the model. Normal is the name of the texture to use as a normal map
for(int i=0;i<LevelNode->getMaterialCount();++i){
// Getting the material
SMaterial &material=LevelNode->getMaterial(i);
// Checking if first texture exists
if(material.Texture1){
// If found changing material type
if(strstr(material.Texture1->getName().c_str(), Diffuse.c_str())){
normalMap = driver->getTexture(Normal.c_str());
material.Texture2=normalMap;
material.MaterialType=(E_MATERIAL_TYPE)NMS->NormalMapShader;
}
}
}
________
Toyota A Transmission History
Last edited by LLDD on Sun Feb 20, 2011 7:49 am, edited 1 time in total.