im using jarheads shader [http://irrlicht.sourceforge.net/phpBB2/ ... ght=normal] for texture splatting on my terrain except when rendered the terrain texture shows no detail only the colour of the texture. i think that this is becuase the texture is being repeated to many times but dont know how to go about fixing it.
this is my shader call back code.
Code: Select all
//this is our services driver
IVideoDriver* driver = services->getVideoDriver();
//ok here is where we set the constants for the shaders
core::matrix4 view_proj_matrix;
view_proj_matrix = driver->getTransform(video::ETS_PROJECTION);
view_proj_matrix *= driver->getTransform(video::ETS_VIEW);
view_proj_matrix *= driver->getTransform ( video::ETS_WORLD );
view_proj_matrix.getTransposed();
services->setVertexShaderConstant("matViewProjection",view_proj_matrix.pointer(),16);
Code: Select all
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"../../media/terrain-heightmap.bmp",
0, // parent node
-1, // node id
core::vector3df(0.f, 0.f, 0.f), // position
core::vector3df(0.f, 0.f, 0.f), // rotation
core::vector3df(40.f, 4.4f, 40.f), // scale
video::SColor ( 255, 255, 255, 255 ), // vertexColor
5, // maxLOD
scene::ETPS_17, // patchSize
4 // smoothFactor
);
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
terrain->setMaterialTexture(0,
driver->getTexture("../../media/alphamap.png"));
terrain->setMaterialTexture(1,
driver->getTexture("../../media/textureOne.jpg"));
terrain->setMaterialTexture(2,
driver->getTexture("../../media/textureTwo.jpg"));
terrain->setMaterialTexture(3,
driver->getTexture("../../media/textureThree.jpg"));
terrain->setMaterialType(EMT_TS);