Multi Texture Terrain - Help Needed!! :S

Posted By: Norby

Multi Texture Terrain - Help Needed!! :S - 01/08/12 18:52

Hi guys!

Can someone tell me EXACTLY how to create "high resolution"multi-texture terrain?


I've created a terrain already in 3ds max. Than unwrapped the UVs and painted the stuff in Photoshop. Than back to 3ds ->export to MED -> save it.

So it works that way, but the textures look very very BAD when you are close. So its not good that way.


Than I found in the shader library that "mtl_terraintex" thingy. It sounds goood but dont know how it works exactly.
I can create alpha channel TGAs in Photoshop its not a problem.

But how do you assign multiple alpha layer textures to a whole terrain?? I tried all day but cant figure it out.

IF someone knows the answer please help me! THANX!!
Posted By: Espér

Re: Multi Texture Terrain - Help Needed!! :S - 01/08/12 19:58

everything you need is written in the mtlfx.c

Here:
Code:
//action: fx_terraintex3
//title: 3-Textures Terrain 
//
//skill2: ScaleSkin2 15
//help: Skin2 base texture scale, 1..50, default 15.
//skill3: ScaleSkin3 15
//help: Skin3 red texture scale, 1..50, default 15.
//skill4: ScaleSkin4 15
//help: Skin4 green texture scale, 1..50, default 15.
//desc:
/// Blends 3 textures together, according to
/// the red and green channel in the first skin.
/// The blue channel can be used for a shadow map. 
/// Skin1 = Terrain RGB blend & shadow mask.
/// Skin2 = Base tiled terrain texture (grass).
/// Skin3 = Red channel masked tiled texture (sand).
/// Skin4 = Green channel masked tiled texture (rock).
/// Skin5 = Optional base texture for non-shader hardware.
/// Skin6 = Optional detail texture for non-shader hardware.
//
//Based on ideas by Thomas 'ventilator' Oppl
//and Eric 'Steempipe' Hendrickson-Lambert
//


Posted By: Norby

Re: Multi Texture Terrain - Help Needed!! :S - 01/08/12 20:46

Thanks for your answer!

Can you give me an example code how does it works exactly?

1. I create a terrain
2. Texture1: RGB map
3. Texture2: Grass (etc.)
4. Texture3: Sand
5. Apply fx_terraintex3 action

Than? O.o
Posted By: Espér

Re: Multi Texture Terrain - Help Needed!! :S - 01/08/12 20:57

1.)
I think creating a terrain is not that great problem.. (you said that you created one with 3dsmax)

2. - 4.)
you just set the blendmap on your modelskin 1 (in MED)

The blendmap is:
Black = 2nd Modelskin
Red color = 3rd modelskin
Green Color = 4th modelskin

Skin 5 and 6 of the model are for players with PCs of non-shader compatible hardware.

All you need to do is draw a Black/Green/Red Picture and set this as Skin1
On Skin 2-4 you set different Textures.. f.e.:
Skin2 = Grass
Skin3 = Sand
Skin4 = Rock

5.) just use
Code:
entityname.material = mtl_terraintex3;



the difference between mtl_terraintex3 and mtl_terraintex is:
http://www.conitec.net/beta/amaterial2.htm#mtl_terraintex
Posted By: Norby

Re: Multi Texture Terrain - Help Needed!! :S - 01/08/12 21:13

Thank you a lot!! I'll try it.
Posted By: thorus

Re: Multi Texture Terrain - Help Needed!! :S - 12/22/12 15:28

anyone have an idea why the texture of the terrain wich was created with the terraintex3 fx doesnt show the camera.ambient?
Posted By: sivan

Re: Multi Texture Terrain - Help Needed!! :S - 12/22/12 15:34

maybe terrain material ambient is zero
Posted By: thorus

Re: Multi Texture Terrain - Help Needed!! :S - 12/22/12 15:38

sorry for the question but where in the fx_terraintex3 code can i raise the terrain ambient?
Posted By: sivan

Re: Multi Texture Terrain - Help Needed!! :S - 12/22/12 17:36

not in the fx, but in the MATERIAL definition, where you assigned effect="terraintex3.fx"; you can set ambient.red .green and .blue. as I know the fx gets these values by the engine and uses them in the fx.
© 2024 lite-C Forums