I posted one ages ago, It will be available at Acknex Unlimited as a demo or wdl in the next week or so. If you can't wait that long for a working demo, here's my original code:
// Shader.wdl
material bump_model //assaign all models this material in script
{
flags = tangent;
}
action Shader_Bumpmap
{
my.material = bump_model;
}
bmap yournormalmapnameDOT3 = <yournormalmapname.tga>;
material yourwadtexturename
{
skin1 = yournormalmapnameDOT3;
flags = tangent;
}
starter load_shaders()
{
d3d_automaterial=1;
effect_load(bump_model,"bumpmap_ent.fx");
effect_load(yourwadtexturename,"bumpmap.fx");
}
//bumpmap.fx
matrix matWorldViewProj;
matrix matWorld;
texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;
technique dot3map
{
pass p0
{
Texture[0] = <mtlSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <entSkin1>;
TextureFactor = 0xFFFFFFFF;
COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;
COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 0;
magFilter[2]=Linear;
minFilter[2]=Linear;
mipFilter[2]=Linear;
COLOROP[2] = Modulate;
COLORARG1[2] = Texture;
COLORARG2[2] = Current;
TexCoordIndex[2] = 1;
}
}
//Bumpmap_ent
matrix matWorldViewProj;
matrix matWorld;
texture mtlSkin1;
texture entSkin1;
texture entSkin2;
vector vecLight;
technique dot3map
{
pass p0
{
Texture[1] = <entSkin1>;
Texture[0] = <entSkin2>;
TextureFactor = 0xFFFFFFFF;
COLOROP[0] = DotProduct3;
COLORARG1[0] = Texture;
COLORARG2[0] = TFactor;
TexCoordIndex[0] = 1;
magFilter[1]=Linear;
minFilter[1]=Linear;
mipFilter[1]=Linear;
COLOROP[1] = Modulate;
COLORARG1[1] = Texture;
COLORARG2[1] = Current;
TexCoordIndex[1] = 1;
}
}
Enjoy, Matt Coles