I have this problem with the parallax map...
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( );