i'm slowly becoming mad. I've set up register combiners to do diffuse light and works fine. I use tex0 for normal map, tex1 for cube map and tex2 for decal texture. So i should do tex2 * (tex0 dot tex1) right? Here's the code:
//1 general combiner
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 1);
//combiner 0 does tex0.rgb dot tex1.rgb -> spare0.rgb,
glCombinerInputNV( GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0_ARB,GL_EXPAND_NORMAL_NV, GL_RGB);
glCombinerInputNV( GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, GL_TEXTURE1_ARB,GL_EXPAND_NORMAL_NV, GL_RGB);
glCombinerOutputNV( GL_COMBINER0_NV, GL_RGB, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV,GL_NONE, GL_NONE, GL_TRUE, GL_FALSE, GL_FALSE);
glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
i've tryied this and works. Now all i want to do is to add some attenuation (tex3) . I've created a 3d texture and now all i should do is: tex2 * ( tex3 * (tex0 dot tex1) ) , is this right? So i've changed the final combiner this way:
//do constant spare0*tex2 in the EF multiplier
glFinalCombinerInputNV(GL_VARIABLE_E_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_F_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
//do tex3*spare0*tex2
glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_TEXTURE3_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_E_TIMES_F_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
but nothing changes! what's wrong?