parallax mapping

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
ghiboz
Posts: 37
Joined: Tue Jan 15, 2008 12:09 pm
Location: Centallo (I)
Contact:

parallax mapping

Post by ghiboz »

hi all!
I have this problem with the parallax map...

Image

here is my code to do this:

Code: Select all

			Smgr->getMeshManipulator()->makePlanarTextureMapping( groundMeshes[i]->getMesh(0), 0.003f );
			
			video::ITexture* colorMap = Driver->getTexture( "rockwall.bmp" );
			video::ITexture* normalMap = Driver->getTexture( "rockwall_height.bmp" );
			Driver->makeNormalMapTexture( normalMap, 9.0f );

			//Ground = Smgr->addAnimatedMeshSceneNode( groundMeshes[0] );
			scene::IMesh* tangentMesh = Smgr->getMeshManipulator()->createMeshWithTangents(	groundMeshes[i]->getMesh(0) );

			Ground = Smgr->addMeshSceneNode( tangentMesh );
			Ground->setMaterialTexture( 0, colorMap );
			Ground->setMaterialTexture( 1, normalMap );

			Ground->getMaterial( 0 ).SpecularColor.set( 0,0,0,0 );

			Ground->setMaterialFlag( video::EMF_FOG_ENABLE, true );
			Ground->setMaterialType( video::EMT_PARALLAX_MAP_SOLID );
			Ground->getMaterial( 0 ).MaterialTypeParam = 0.035f; // adjust height for parallax effect

			// drop mesh because we created it with a create.. call.
			tangentMesh->drop( );
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Are you sure that the planar mapping creates a proper texturing of your ground mesh? Otherwise the tangents will be completely weird and produce arbitrary results.
ghiboz
Posts: 37
Joined: Tue Jan 15, 2008 12:09 pm
Location: Centallo (I)
Contact:

Post by ghiboz »

I tried to remove the planar.. this is the result:
Image

if I use the default texture ( not parallax ) the map is ok:
Image
Post Reply