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.
Zedith
Posts: 5 Joined: Mon Oct 20, 2008 7:31 pm
Location: Estonia
Post
by Zedith » Fri Oct 24, 2008 5:31 pm
When I open my map files in other 3d viewing and coding(programming) programs then the textures are correct but in irrlicht it plays crazy. Sometimes the wall textures are rotated 90 degrees and stretching textures doesn't work either correctly. I tested .x and .b3d.
I'm sure that the texture coords are correct...
Any ideas fixing this?
My code: (simple copy, paste, modify)
Code: Select all
scene::IAnimatedMesh* roomMesh = smgr->getMesh("maps/DeMa_cs/crate1.x");
scene::ISceneNode* room = 0;
if (roomMesh)
{
smgr->getMeshManipulator()->makePlanarTextureMapping(
roomMesh->getMesh(0), 0.003f);
video::ITexture* colorMap = driver->getTexture("maps/DeMa_cs/crate1.jpg");
video::ITexture* normalMap = driver->getTexture("maps/DeMa_cs/crate1b.jpg");
driver->makeNormalMapTexture(normalMap, 9.0f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));
room = smgr->addMeshSceneNode(tangentMesh);
room->setMaterialTexture(0, colorMap);
room->setMaterialTexture(1, normalMap);
room->getMaterial(0).SpecularColor.set(0,0,0,0);
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
room->getMaterial(0).MaterialTypeParam = 0.035f; // adjust height for parallax effect
tangentMesh->drop();
}
bitplane
Admin
Posts: 3204 Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:
Post
by bitplane » Fri Oct 24, 2008 6:33 pm
Can you please supply the mesh file too?
edit: Oh, makePlanarTextureMapping will destroy your texture coordinates. Try removing this line!
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Fri Oct 24, 2008 6:58 pm
I guess someone should provide a new room mesh which will avoid this line, it simply makes the tutorial users completely crazy
Zedith
Posts: 5 Joined: Mon Oct 20, 2008 7:31 pm
Location: Estonia
Post
by Zedith » Fri Oct 24, 2008 10:34 pm
Oh Now I know what I should do after doing a tutorial - analyze all commands.
That bump map effect looks awesome.. I used cs 1.6 textures.
Thanks guys!
Acki
Posts: 3496 Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:
Post
by Acki » Fri Oct 24, 2008 10:56 pm
Zedith wrote: Oh Now I know what I should do after doing a tutorial - analyze all commands.
that's what tutorials are for !!!
BlindSide
Admin
Posts: 2821 Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!
Post
by BlindSide » Sat Oct 25, 2008 5:45 am
hybrid wrote: I guess someone should provide a new room mesh which will avoid this line, it simply makes the tutorial users completely crazy
You can use the one from my XEffects wrapper, it's just as bad looking though:
But atleast the texture coordinates are ok, I just made it in Maplet (Free and easy to use).
ShadowMapping for Irrlicht!:
Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net