texturing, bump mapping problem

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.
Post Reply
Zedith
Posts: 5
Joined: Mon Oct 20, 2008 7:31 pm
Location: Estonia

texturing, bump mapping problem

Post by Zedith »

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();
	}
Image
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Can you please supply the mesh file too?

edit: Oh, makePlanarTextureMapping will destroy your texture coordinates. Try removing this line!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess someone should provide a new room mesh which will avoid this line, it simply makes the tutorial users completely crazy :wink:
Zedith
Posts: 5
Joined: Mon Oct 20, 2008 7:31 pm
Location: Estonia

Post by Zedith »

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. :D

Image

Thanks guys!
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Zedith wrote:Oh Now I know what I should do after doing a tutorial - analyze all commands.
that's what tutorials are for !!! :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

hybrid wrote:I guess someone should provide a new room mesh which will avoid this line, it simply makes the tutorial users completely crazy :wink:
You can use the one from my XEffects wrapper, it's just as bad looking though:

Image

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
Post Reply