It's not great... but it may give you a start. You'll have to play with the textures. You can modify it alot... Leave it as is, and/or modify it with some pieces of code from the ones that turn black. Things like the projected texture. Adding another stage with a colormap or envmap.
However, you will not be able to add a lookup into a cubic environment map. The Geforce will not do the dependant texture reads for it.
The pixelshader.1.1 water code I have is not open source yet... sorry.
Code:
bmap water_bump = <water_bump.tga>;
bmap water_spec = <water_spec.tga>;
function mtl_water_func();
function mtl_water_func()
{
mtl.skill1 += time;
mtl.matrix23 = floatd(mtl.skill1,180); // u offset ????? Something changed????
mtl.matrix13 = floatd(mtl.skill1,200); // u offset
}
function mtl_water_init()
{
mat_set(mtl.matrix,matWorld);
mtl.matrix11 = float(4.5);
mtl.matrix22 = float(2.0);
mtl.matrix41 = 0;
mtl.matrix42 = 0;
mtl.matrix43 = 0;
bmap_to_mipmap(mtl.skin2);
bmap_to_uv(mtl.skin1);
mtl.event = mtl_water_func;
mtl.enable_view = on;
}
material mtl_water
{
skin1=water_bump;
skin2=water_spec;
event = mtl_water_init;
effect = "
matrix matMtl;
texture mtlSkin1;
texture mtlSkin2;
vector vecLight;
technique ffpwater
{
pass p0
{
AlphaBlendEnable = True;
Lighting = True;
DitherEnable = True;
zWriteEnable = True;
zEnable = True;
CullMode = none;
specularenable=true;
ambient= <vecLight>;//0x00010104;
Texture[0] = <mtlSkin1>;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;
ColorArg1[0] = Texture;
ColorOp[0] = BumpEnvMapLuminance;
ColorArg2[0] = Diffuse;
BumpEnvLScale[0]=0.1;
BumpEnvLOffset[0]=0.8f;
TexCoordIndex[0]= 0;
TextureTransformFlags[0] = Count2;
TextureTransform[0]=
{
3.0, 0.0, 0.0, 0.0, //u
0.0, 6.0, 0.0, 0.0, //v
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};
Texture[1] = <mtlSkin2>;
magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;
ColorArg1[1] = Texture;
ColorOp[1] =Modulate;
ColorArg2[1] = Current;
TextureTransform[1] = <matMtl>;
TextureTransformFlags[1] =count2;
TexCoordIndex[1]= 1;
ColorOp[2] = Disable;
AlphaOp[2] = Disable;
}
}
technique fallback { pass p0 { } }
";
}
action ffp_Water {
my.metal=off;
my.flare=off;
my.transparent=on;
my.alpha=60;
my.material = mtl_water; }