I've begun to build mine back into HLSL (so far so good, *crosses fingers*), here's how I manage the two passes:
Code:
technique normalMapping
{
pass EnvLight
{
//globals
zwriteenable= true;
zenable = true;
//shaders
VertexShader = compile vs_1_1 vs_main();
PixelShader = compile ps_1_4 ps_main();
}
pass DynLight
{
//globals
zwriteenable= true;
zenable = true;
Lighting=True;
AlphaBlendEnable=True;
SrcBlend=One;
DestBlend=InvSrcColor;
BlendOp=Add;
//locals
ColorOp[0]=SelectArg1;
ColorArg1[0]=Texture;
Alphaop[0]=SelectArg1;
AlphaArg1[0]=Texture;
//shaders
VertexShader = compile vs_1_1 vs_main2();
PixelShader = compile ps_1_4 ps_main2();
}
}
vs_main2() and ps_main2() omit the base texture and only render the lighting pass; it is rendered with alpha blending over the other pass, illuminating the texture from it.
Of course, there are also advantages to keeping both lights in a single pass, as you can condense the shader more and not worry about going overkill :P.
-Rhuarc