Terrain material blending question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
swatter555
Posts: 14
Joined: Wed Sep 27, 2006 1:30 am

Terrain material blending question

Post by swatter555 »

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?
swatter555
Posts: 14
Joined: Wed Sep 27, 2006 1:30 am

Post by swatter555 »

I have been searching the forums all day to get more info, and the only conclusion I can come up with is that Irrlicht wont support more than two textures on a terrain node. Is this correct?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht does not support more than two textures with any material. But you can easily add new materials.
swatter555
Posts: 14
Joined: Wed Sep 27, 2006 1:30 am

Post by swatter555 »

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.
AmigaIrr
Posts: 94
Joined: Mon Jan 10, 2005 7:55 am
Location: France, Alsace

Post by AmigaIrr »

HELLO

can you link the .exe ?
L'eternité c'est long, surtout vers la fin...

Q6600 triton 79, 4 GO, 2* RAPTOR 150GO of ARECA 256 RAID 0, 3870 Zalmann, P5K. 24" Samsung. Antec nine hundred
Post Reply