i experimented a little and found a way to do it with a fixed function effect. the way i found seems to be a bit strange to me though. i assume there is a better one which only requires 3 stages? (i am not a friend of fixed function effects...

)
Code:
var d3d_automaterial=1;
bmap b_luminosity1=<luminosity1.tga>;
material checker1
{
skin1=b_luminosity1;
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;
}
}
";
}
all color channels of the luminosity map will be used. the material name has to be the same as the name of the level surface texture which should display the material (this is the way of assigning materials to level surfaces).
if you want to apply the effect to several different level textures you could do it this way:
Code:
bmap b_luminosity2=<luminosity2.tga>;
material groundtexture2
{
skin1=b_luminosity2;
}
bmap b_luminosity3=<luminosity3.tga>;
material metaltexture_tga
{
skin1=b_luminosity3;
}
...
starter copy_effects()
{
wait(1);
groundtexture2.effect=checker1.effect;
metaltexture.effect=checker1.effect;
...
}