You mean you want the lighting shader to shade your textures instead of vertex colors? In that case, try thsi:
//Cg
//
//Cg profile arbvp1 arbfp1
void vshader(float4 vtx_position : POSITION,
float3 vtx_normal : NORMAL,
float2 vtx_texcoord0 : TEXCOORD0,
out float4 l_position : POSITION,
out float2 l_texcoord0: TEXCOORD0,
out float4 l_brite : TEXCOORD1,
uniform float4 mspos_light,
uniform float4x4 mat_modelproj)
{
l_position = mul(mat_modelproj, vtx_position);
float3 N = normalize(vtx_normal);
float3 lightVector = normalize(mspos_light - vtx_position);
l_brite = max(dot(N,lightVector), 0);
l_texcoord0=vtx_texcoord0;
}
void fshader(float4 l_brite : TEXCOORD1,
float2 l_texcoord0: TEXCOORD0,
uniform sampler2D tex_0 : TEXUNIT0,
out float4 o_color : COLOR)
{
if (l_brite.x<0.5) l_brite=0.8;
else l_brite=0.9;
float4 texture=tex2D(tex_0, l_texcoord0);
o_color=l_brite * texture;
}
I didn’t try it, though it should be working. Let me know if not.