Looks really neat. If you are interested, I did this simpler effect for Marco Gubert,(someone gave me a hand with it) which can look basically like a carbon copy of the A5/A6 detail mapping. Maybe you can find it somewhat useful...
Code:
/////////////////////////////////////////////
// Give your Terrain 2 Skins
// Skin 1 - The texture (non-tileable)
// Skin 2 - The detail map (tileable)
//
///////////////////////////////////////////////////
function mtl_terraintex_init(){
// Adjust the texture transform to do some tiling of the textures
mtl.matrix11 = float(8); // default u scale
mtl.matrix22 = float(8); // default v scale
}
material mat_terrain_detail
{
event = mtl_terraintex_init;
effect = "
matrix matMtl;
texture entSkin1;
texture entSkin2;
technique t0
{
pass p0
{
Texture[0] = <entSkin1>;
Texture[1] = <entSkin2>;
TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
TexCoordIndex[1] = 1;
ColorOp[0] = Modulate2x;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[1] = AddSigned;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[2] = Disable;
AlphaOp[0] = Disable;
}
}";
}
//////////////////////////////
//WED action for Terrain:
//////////////////////////////
action ffp_terr_detail
{
my.transparent=off;
my.material = mat_terrain_detail;
}
cu