Hi all,
My normalmap problems are over. I have solved it, with a little bit of help heh heh.
There are no seams and it looks as good as it will under the current shader. Obviously a shader could make it look better, as I could add specular colour too, which would make it more realistic, but it is good enough for me to carry on with the game.
Here is the answer. Well the main answer is the new exporter that Lalin sent me. Although that didn't do it on it's own. The little bit of code he sent me helped as well. I put that in my LoadManager class and it worked. The great thing is. I don't have to load the textures. It is in the x file now eg Below is a small snippet from inside the x file
Code: Select all
TextureFilename {
"Diffuse.tga";
}
TextureFilename {
"nrm.tga";
}
Ok here is my function from my LoadManager class to load my model. Obvioiusly I would use a different function for animation.
Code: Select all
void LoadManager::loadPiece(ISceneManager* smgr,IVideoDriver* driver,const wchar_t* modelname)
{
mesh = smgr->getMesh(modelname);
((scene::ISkinnedMesh*)mesh)->convertMeshToTangents();
scene::IMeshBuffer* mb = mesh->getMeshBuffer(0);
if (mb)
{
video::SMaterial& mt = mb->getMaterial();
mt.MaterialType = video::EMT_NORMAL_MAP_SOLID;
}
node = smgr->addMeshSceneNode(mesh);
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, true);
node->addShadowVolumeSceneNode();
}
camera = smgr->addCameraSceneNode(node,vector3df(0, 60, 0));
camera->bindTargetAndRotation(true);
camera->setTarget(node->getPosition());
}
Ignore the camera bit, that isn't needed except in my game.
And here is a screenshot. showing many different angles.
Sorry they are small, but I can guarantee the model is perfect
Now the problem with the shadows still occur, but I believe this is a separate problem. Sometimes if you move the grenade under the light in a certain position you get strange squares, but apart from that it works.
Now I have another question. Seeing an x file is just text. Would it be possible to put that said text inside the program, and load the model from that?
I don't need to do this yet, but this way the model would be embedded in the exe. I mean if it can read it from a file, it should be possible.
My game is only small and will have very few models, so it would be a bonus to keep them in the exe itself.
Anyway I hope another beginner like myself finds this post and is able to get their models to load in, and thanks for the all the help CuteAlien.
PS. You can get the Lalin Axe exporter from here, but I would wait a bit as the bugfixed version isn't available yet.
http://www.cgdev.net/download.php
PPS. You may have noticed I have now finished the Tomopoly board. Everything you see on that board I have drawn in illustrator.