I have being messing around trying implement basic texture splatting without using any shaders, My idea was to use EMT_SOLID_2_LAYER and apply that to a terrainscenenode and then edit the vertex Alpha value to blend the two textures together.
I start by creating the terrain:
Code: Select all
p_Terrain = C_Editor::get_editor_Handle()->ip_smgr->addTerrainSceneNode(
"heightmap.bmp");
p_Terrain->setMaterialFlag(EMF_LIGHTING, false);
p_Terrain->setMaterialTexture(0, texture1);
p_Terrain->setMaterialTexture(1, texture2);
p_Terrain->setMaterialType(EMT_SOLID_2_LAYER);
Code: Select all
p_Vertices[Vertex].Color.setAlpha(Alpha -= 4);
Code: Select all
C_Editor::get_editor_Handle()->p_smgr->getVideoDriver()->removeTexture(texture1);
C_Editor::get_editor_Handle()->p_smgr->getVideoDriver()->removeTexture(texture2);
texture1 = C_Editor::get_editor_Handle()->p_smgr->getVideoDriver()->getTexture("terrain-texture.jpg");
texture2 = C_Editor::get_editor_Handle()->p_smgr->getVideoDriver()->getTexture("terrain-texture2.jpg");
p_Terrain->setMaterialTexture(0, texture1);
p_Terrain->setMaterialTexture(1, texture2);
Any help would be appreciated. Thank you for your time!