1 registered members (AndrewAMD),
911
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
terraintex.fx for an unlimited number of terrain textures?
#338885
08/22/10 11:55
08/22/10 11:55
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Why does it say "Terrain material for an unlimited number of terrain textures"? This makes no sense!
//////////////////////////////////////////////////////////////////////
// terraintex.fx
// Terrain material for an unlimited number of terrain textures
// Tiled texture on RGB, mask on alpha
Texture entSkin1; // basic tiled terrain texture
Texture LightMap; // lightmap created by the map compiler
bool PASS_SOLID; // enforce rendering on the solid pass
bool AUTORELOAD;
//////////////////////////////////////////////////////////////////////
// technique without lightmap
technique terraintex
{
pass multi_repeat11
{
ZWriteEnable = True;
AlphaBlendEnable = True;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
Texture[0] = <entSkin1>;
TexCoordIndex[0] = 0;
AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
Texture[1] = <entSkin1>;
TexCoordIndex[1] = 1;
ColorArg1[1] = Texture;
ColorArg2[1]= Diffuse;
ColorOp[1] = Modulate2x;
AlphaArg1[1] = Current;
AlphaOp[1] = SelectArg1;
ColorOp[2] = Disable;
AlphaOp[2] = Disable;
}
}
// technique with lightmap
technique terraintex_lm
{
pass multi_repeat11
{
ZWriteEnable = True;
AlphaBlendEnable = True;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
Texture[0] = <entSkin1>;
TexCoordIndex[0] = 0;
AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
Texture[1] = <LightMap>;
TexCoordIndex[1] = 0;
ColorArg1[1] = Texture;
ColorArg2[1]= Diffuse;
ColorOp[1] = AddSigned;
AlphaArg1[1] = Current;
AlphaOp[1] = SelectArg1;
Texture[2] = <entSkin1>;
TexCoordIndex[2] = 1;
ColorArg1[2] = Texture;
ColorArg2[2]= Current;
ColorOp[2] = Modulate2x;
AlphaArg1[2] = Current;
AlphaOp[2] = SelectArg1;
ColorOp[3] = Disable;
AlphaOp[3] = Disable;
}
}
// fallback if nothing works
technique fallback { pass one { } }
|
|
|
Re: terraintex.fx for an unlimited number of terrain textures?
[Re: Pappenheimer]
#338887
08/22/10 12:06
08/22/10 12:06
|
Joined: Apr 2010
Posts: 172
wdlmaster
Member
|
Member
Joined: Apr 2010
Posts: 172
|
From the shader section of the manual: Passes can have arbitrary names, with the following exception (A7.60): If the first pass name contains the character sequence "_repeat", the pass is repeated for every skin of the model. After each pass the skins assigned to entSkin1..entSkin3 are incremented by 1. So if the model has 5 skins, the pass is repeated 5 times, with entSkin1 set to the model's first, second, third, fourth, and fifth skin in succession. This special method can be used to render an arbitrary number of skins, for instance for multitexture terrain with 4 or more textures.
|
|
|
Re: terraintex.fx for an unlimited number of terrain textures?
[Re: Pappenheimer]
#338982
08/23/10 13:52
08/23/10 13:52
|
Joined: Apr 2010
Posts: 172
wdlmaster
Member
|
Member
Joined: Apr 2010
Posts: 172
|
replace the "lightmap" texture with another bitmap. You must define a BMAP* and use the same name + _bmap in the shader code. Example: in the script:
BMAP* lightmap123 = "lightmap123.tga";
in the shader:
texture lightmap123_bmap;
...
...
texture[1] = <lightmap123_bmap>;
...
...
|
|
|
Re: How can I use terraintex.fx?
[Re: Pappenheimer]
#341599
09/18/10 13:59
09/18/10 13:59
|
Joined: Nov 2004
Posts: 85 Deutschland, NRW, Eschweiler
annonymie
Junior Member
|
Junior Member
Joined: Nov 2004
Posts: 85
Deutschland, NRW, Eschweiler
|
Hello, I also have a problem with that Shader.
I created a terrain with a skin (DDS with complete white Alpha channel). I only need a terrain with a grass texture. Without the shader it's too diffuse.
Are there any tutorials? I've already read the infos in the manual.
A8.30.5 Commercial
|
|
|
Re: How can I use terraintex.fx?
[Re: annonymie]
#341602
09/18/10 14:36
09/18/10 14:36
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
Serious User
|
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
Hello, I also have a problem with that Shader.
I created a terrain with a skin (DDS with complete white Alpha channel). I only need a terrain with a grass texture. Without the shader it's too diffuse.
Are there any tutorials? I've already read the infos in the manual. Yes please a tutorial would be great. I too have problems with this shader.
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
Re: How can I use terraintex.fx?
[Re: Nidhogg]
#341611
09/18/10 16:47
09/18/10 16:47
|
Joined: Apr 2010
Posts: 172
wdlmaster
Member
|
Member
Joined: Apr 2010
Posts: 172
|
...but I miss something like detail_size...
You must set detail_size before loading the terrain I only need a terrain with a grass texture. Without the shader it's too diffuse.
If you only use ONE texture, you don't need that shader at all. Yes please a tutorial would be great. I too have problems with this shader.
What kind of problems? If you mean the detail_size, set it BEFORE the terrain is loaded. If you mean the blending of the textures, look in the manual. But i would not recommend this shader anyway, because it's very ineffective. Every texture is rendered in a seperate pass!
|
|
|
|