Can somebody help me with importing this luminosity shader from the wiki so it will work with models? I don't even know how a shader works, so i compared this shader with some other ones to solve the problem by myself, but.. nah, first my model gets very bright and then it was just too dark. So, can somebody help me?

This is the shader code i use:
Code:

var d3d_automaterial=1;

bmap lum_map = <luminosity_test.tga>;

material luminosity_shader
{
skin1=lum_map;

effect=
"

texture mtlSkin1;
texture entSkin1;

technique luminosity_mapping
{
pass p0
{
texture[2]=<entSkin1>;
texture[3]=<mtlSkin1>;


colorarg1[0]=texture; // shadow map
colorarg2[0]=diffuse; // vertex lighting
colorop[0]=add; // add vertex lighting to shadow map


colorarg1[1]=texture; // color map
colorarg2[1]=current; // (shadow map + vertex lighting)
colorop[1]=modulate2x; // modulate color map with (shadow map + vertex lighting)
resultarg[1]=temp; // output to temp register


colorarg1[2]=texture; // color map
colorop[2]=selectarg1;

magfilter[2]=linear;
minfilter[2]=linear;
mipfilter[2]=linear;
texcoordindex[2]=1;


colorarg1[3]=current; // unshaded color map
colorarg2[3]=temp; // shaded color map
colorarg0[3]=texture; // luminosity map
colorop[3]=lerp; // interpolate between shaded color map and unshaded color map depending on luminosity map

magfilter[3]=linear;
minfilter[3]=linear;
mipfilter[3]=linear;
texcoordindex[3]=1;
}
}
";
}



Thanks