And last of all... there is the TexBemL shader version that worked on ATI's only, I believe.
Code:
// *************************************************
// * TexBeml Water
// *************************************************
bmap basemap = <water1.bmp>;
bmap bumpmap = <waterbump1.bmp>;
MATERIAL mat_texbeml_water
{
Flags = tangent;
Skin1 = basemap;
Skin2 = bumpmap;
effect=
"
texture mtlSkin1;
texture mtlSkin2;
matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;
vector vecSunDir;
vector vecDiffuse;
vector vecAmbient;
vector vecFog;
vector vecSkill41;
vector vecLight;
vector vecViewPos;
Technique bump_spec
{
Pass p0
{
alphablendenable=true;
srcblend=one;
destblend=zero;
texture[0]=<mtlSkin2>;
texture[1]=<mtlSkin1>;
MagFilter[1]=Linear;
MinFilter[1]=Linear;
MipFilter[1]=Linear;
texcoordindex[1]=1;
texturetransformflags[1]=count2;
//BumpEnvMat00[1] = 0.5f;
//BumpEnvMat01[1] = 0.0f;
//BumpEnvMat10[1] = 0.0f;
//BumpEnvMat11[1] = 0.5f;
MagFilter[0]=linear;
MinFilter[0]=linear;
MipFilter[0]=linear;
BUMPENVLSCALE[1]=1.8;
BUMPENVLOFFSET[1]=2.8;
texcoordindex[0]=0;
texturetransformflags[0]=count2;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matWorld>;
vertexShaderConstant[8]=<matWorldView>;
VertexShaderConstant[41]=<vecSkill41>;
VertexShaderConstant[11]={0.0f, 0.6f, 0.0f, 0.0f};//0.2
VertexShaderConstant[12]={0.0f, -0.8f, 0.0f, 0.0f};
// scale - change according to model scaleing
VertexShaderConstant[14]={0.8f, 1.5f, 0.0f, 0.0f};//1.5 and 1.2
VertexShaderConstant[15]={1.0f, 1.0f, 0.0f, 0.0f};
vertexShaderConstant[17]=<vecSunDir>;
vertexShaderConstant[18]=<vecDiffuse>;
vertexShaderConstant[19]=<vecAmbient>;
//vertexShaderConstant[20]=<vecLight>;
vertexShaderConstant[21]=<vecFog>;
vertexShaderConstant[95]=(0.0f,0.0f,0.0f,0.0f);
vertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //Tex
float v8[3]; //uv
}
asm
{
vs.1.1
// Transform position
m4x4 oPos, v0, c0
m3x3 r0,v3,c4 // transform normal to world space
dp3 r0.w,r0,r0 // renormalize it
rsq r0.w,r0.w
mul r0,r0,r0.w
//dp3 r0,r0,-c17 // normal.light -> lighting constant
//mul r0.xyz,r0,c18 // modulate against material diffuse color
//add oD0.xyz,r0,c19 // add environment light
// Time
mov r0, c41.x
// Compute texture coordinates for 1st noise texture
mul r1, r0, c11
frc r1.xy, r1
mad oT0, v7, c14.xyxy, r1.xyxy
// Compute texture coordinates for 2nd noise texture
mul r1, r0, c12
frc r1.xy, r1
mad oT1, v7, c15.xyxy, r1.xyxy
mov r1.w,c21.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c21.x // distance-fog_start
mad r0.x,-r0.x,c21.z,r1.w // 1-(distance-fog_start)*(1/(fog_end-fog_start))
max oFog.x,r0.x,c95.w // clamp with custom max value
};
pixelShader=
asm
{
ps.1.1
tex t0
texbeml t1, t0
mov r0, t1
}; //end of PS
} //end of pass
} //end of technique
"; //end of effect
} //end of material
starter mat_terrain_multitexture_init
{
//bmap_to_uv(mat_texbeml_water.Skin2);
bmap_to_normals(mat_texbeml_water.Skin2,2);//0.2
bmap_to_mipmap(mat_texbeml_water.skin1);
bmap_to_mipmap(mat_texbeml_water.skin2);
}
var ShaderCount;
ACTION texbeml_water
{
my.material = mat_texbeml_water;
my.transparent=off;
while(1)
{
my.skill41=float(ShaderCount);
my.skill42=float(0);
my.skill43=float(0);
my.skill44=float(0);
ShaderCount += 0.0015;
wait(1);}
}