And here is the Water_Test_5 that may work on some of the geforce cards:
Read the fine print!!!
Code:
////////////////////////////////////////////////////////
// Environment Mapping Bump Mapping Water
//
// This is the code that may have worked on some geforce cards
//
////////////////////////////////////////////////////////
/*
Test 1,2,3,& 4 evidentally showed as black on geforce.
Note: for the troubleshooter's among us: How I got to test 5 was this way:
I took my waterbump.bmp and used ATI's "DUDVMapGenerator" and "NormalMapGenerator".
spit out each version of the waterbump map.
=========================================
Test #1:
=========================================
bmap waterbump = <waterbumpDOT3.tga>; //<<<<< note the texture formats
bmap baseskin = <water1.bmp>;
function mtl_ffpwater_init()
{
//bmap_to_normals(mtl.skin1,1);//0.2
//bmap_to_uv(mtl.Skin1);
mtl.enable_view = on;
}
=========================================
Test #2:
=========================================
bmap waterbump = <waterbumpDUDV.tga>;
bmap baseskin = <water1.bmp>;
function mtl_ffpwater_init()
{
//bmap_to_normals(mtl.skin1,1);//0.2
//bmap_to_uv(mtl.Skin1);
mtl.enable_view = on;
}
=========================================
Test #3:
=========================================
bmap waterbump = <waterbumpDUDV.tga>;
bmap baseskin = <water1.bmp>;
function mtl_ffpwater_init()
{
bmap_to_normals(mtl.skin1,1);//0.2
//bmap_to_uv(mtl.Skin1);
mtl.enable_view = on;
}
=========================================
Test #4:
=========================================
bmap waterbump = <waterbumpDOT3.tga>;
bmap baseskin = <water1.bmp>;
function mtl_ffpwater_init()
{
bmap_to_normals(mtl.skin1,1);//0.2
//bmap_to_uv(mtl.Skin1);
mtl.enable_view = on;
}
=========================================
Test #5:
=========================================
*/
bmap waterbump = <waterbumpDOT3.tga>;
bmap baseskin = <water1.bmp>;
function mtl_ffpwater_init()
{
bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);
//bmap_to_normals(mtl.skin1,1);//0.2
bmap_to_uv(mtl.Skin1);
mtl.enable_view = on;
}
material mtl_ffpwater
{
skin1=waterbump;
skin2=baseskin;
event = mtl_ffpwater_init;
effect = "
matrix matWorldViewProj;
matrix matViewInv;
vector vecDiffuse;
vector vecSkill41;
vector vecSunDir;
vector vecLight;
vector vecSpecular;
texture mtlSkin1;
texture mtlSkin2;
technique makewater
{
pass p0
{
zwriteenable=true;
zenable=true;
zfunc=less;
zbias=0.0;
ditherenable=false;
specularenable=true;
lighting=false;
specularmaterialsource=color2;
diffusematerialsource=Color1;
NormalizeNormals=false;
LocalViewer=True;
alphafunc=less;
AlphaBlendEnable = false;
alphatestenable=false;
alpharef=0x0;
SrcBlend = one;
DestBlend = zero;
blendop=add;
fillmode=solid;
fogenable=false;
cullmode=ccw;
clipping=true;
/////////////////////////////////////////
// stage 0 /
/////////////////////////////////////////
Texture[0] = <mtlSkin1>;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;
AddressU[0]=wrap;
AddressV[0]=wrap;
ColorArg1[0] = Texture;
ColorOp[0] = BUMPENVMAPLUMINANCE;
//colorop[0]=bumpenvmap;
ColorArg2[0] = current;
BUMPENVLSCALE[0]=0.8;
BUMPENVLOFFSET[0]=0.0;
TextureTransformFlags[0]=count2;
TexCoordIndex[0]=0;
///////////////////////////////////////
// stage 1
///////////////////////////////////////
Texture[1] = <mtlSkin2>;
magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;
ColorArg1[1] = Texture;
ColorOp[1] =selectarg1;
TextureTransformFlags[1]=count2;
TexCoordIndex[1]=1;
colorop[2] = disable;
alphaop[2] = disable;
vertexShaderConstant[0]=<matWorldViewProj>;
vertexShaderConstant[4]=<matViewInv>;
// scroll speed
VertexShaderConstant[11]={0.09f, 0.04f, 0.0f, 0.0f};
VertexShaderConstant[12]={-0.5f, 0.2f, 0.0f, 0.0f};
// scale
VertexShaderConstant[14]={0.4f, 0.6f, 0.0f, 0.0f};
VertexShaderConstant[15]={1.5f, 1f, 0.0f, 0.0f};
vertexShaderConstant[16]=<vecSunDir>;
vertexShaderConstant[17]=<vecDiffuse>;
vertexShaderConstant[19]=<vecLight>;
vertexShaderConstant[18]=<vecSpecular>;
// Diffuse
// time
VertexShaderConstant[41]=<vecSkill41>;
vertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //uv
}
asm
{
vs.1.1
m4x4 oPos,v0,c0
dp3 r0.x, v3, c4
dp3 r0.y, v3, c5
dp3 r0.z, v3, c6
dp3 r0.w, r0, r0
rsq r0.w, r0.w
mul r0, r0, r0.w
dp3 r0,r0,-c16 // normal.light -> lighting constant
mul r0.xyz,r0,c17 // modulate against material diffuse color
add oD0.xyz,r0,c19 // Spit out Diffuse color register
mov oD1, c18 // Spit out Specular Color Register
mov r0, c41.x
mul r1, r0, c12
frc r1.xy, r1
mad oT1.xy, v7.xy, c15.xy, r1.xy
mul r1, r0, c11
frc r1.xy, r1
mad oT0.xy, v7.xy, c14.xy, r1.xy
};
}
}
technique fallback { pass p0 { } }
";
}
var count;
action ffp_water {
my.metal=on;
my.material = mtl_ffpwater;
while(1)
{
my.skill41=float(Count);
my.skill42=float(0);
my.skill43=float(0);
my.skill44=float(0);
Count += 0.0015;
wait(1);
}
return;
}