Starting out with the base Terrain Rendering example code:
eg::terrain->setMaterialFlag(video::EMF_LIGHTING, false);
eg::terrain->setMaterialTexture(0,eg::gRes->terrain01);
eg::terrain->setMaterialTexture(1,eg::gRes->detail01);
eg::terrain->setMaterialType(video::EMT_DETAIL_MAP);
eg::terrain->scaleTexture(1.0f, 20.0f);
My problem is this: I am using the terrain scene node to create a 3d map locked in a 2d camera position(using 3d to create a 2d map in other words). The first layer (terrain01) is the landmass surrounded by blue water. The second layer is the detail map. The problem comes when the water is textured the same as the landmass, it looks like poo.
I created another texture that only has the water masses on it, the rest is transparent. I want to put this on top of the other two, putting the blue water texture over the detail mapped water. I tried using the EMT_SOLID flag, but that doesnt work right.
Any ideas on how to make this work right?
Terrain material blending question
-
- Posts: 14
- Joined: Wed Sep 27, 2006 1:30 am
-
- Posts: 14
- Joined: Wed Sep 27, 2006 1:30 am
Hybrid,
Thanks for the assistance. I am so new to this engine that I am lost to a great degree, even when you say it would be a simple task to add more materials. I begin looking at the header files and such of scene node and SMaterials, but I need a little push. If you dont mind, I will show you what I want to accomplish, then I would be greatful if you could outline how to do it.
// Landmasses
eg::terrain->setMaterialFlag(video::EMF_LIGHTING, false);
eg::terrain->setMaterialTexture(0,eg::gRes->terrain01);
// Detail for landmasses
eg::terrain->setMaterialTexture(1,eg::gRes->detail01);
eg::terrain->setMaterialType(video::EMT_DETAIL_MAP);
eg::terrain->scaleTexture(1.0f,5.0f);
// Ocean texture to cover the funky looking water of
// the results first two textures.
eg::terrain->setMaterialTexture(2,eg::gRes->terrain02);
eg::terrain->setMaterialType(video::EMT_SOLID_3_LAYER);
I would appreciate any help you could give, even just pushing me in the correct direction.
Thanks for the assistance. I am so new to this engine that I am lost to a great degree, even when you say it would be a simple task to add more materials. I begin looking at the header files and such of scene node and SMaterials, but I need a little push. If you dont mind, I will show you what I want to accomplish, then I would be greatful if you could outline how to do it.
// Landmasses
eg::terrain->setMaterialFlag(video::EMF_LIGHTING, false);
eg::terrain->setMaterialTexture(0,eg::gRes->terrain01);
// Detail for landmasses
eg::terrain->setMaterialTexture(1,eg::gRes->detail01);
eg::terrain->setMaterialType(video::EMT_DETAIL_MAP);
eg::terrain->scaleTexture(1.0f,5.0f);
// Ocean texture to cover the funky looking water of
// the results first two textures.
eg::terrain->setMaterialTexture(2,eg::gRes->terrain02);
eg::terrain->setMaterialType(video::EMT_SOLID_3_LAYER);
I would appreciate any help you could give, even just pushing me in the correct direction.