EMT_SOLID_2_LAYER texture splatting?
Posted: Thu Jun 06, 2013 12:32 pm
Hey,
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:
Then i modifie the vertex Alpha value:
And then i drop and reload the images and apply them to the mesh again:
So far this hasn't worked at all, Am i on the wrong track?
Any help would be appreciated. Thank you for your time!
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!