I’m working on learning to use register combiners, but there is something weird going on and I don’t understand it.
Here’s the setup:
// Enable 1 combiner
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 1);
// Put texture 0 in register A glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
// Set register B to one
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV,GL_ONE, GL_UNSIGNED_IDENTITY_NV,GL_RGB);
// Put A*B in spare 0
glCombinerOutputNV(GL_COMBINER0_NV, GL_RGB, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE);
// A = 0
glFinalCombinerInputNV(GL_VARIABLE_A_NV,
GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
// B = 0
glFinalCombinerInputNV(GL_VARIABLE_B_NV,
GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
// C = 0
glFinalCombinerInputNV(GL_VARIABLE_C_NV,
GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
// D = Spare0
glFinalCombinerInputNV(GL_VARIABLE_D_NV,
GL_SPARE0_NV,GL_UNSIGNED_IDENTITY_NV,GL_RGB);
// E = 0
glFinalCombinerInputNV(GL_VARIABLE_E_NV,
GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
// F = 0
glFinalCombinerInputNV(GL_VARIABLE_F_NV,
GL_ZERO, GL_UNSIGNED_IDENTITY_NV,GL_RGB);
// G = 1
glFinalCombinerInputNV(GL_VARIABLE_G_NV,
GL_ONE, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA);
Now, since the output RGB = AB + (1-A)C + D, whatever I give as input to register A should be all that I see, since everything but D is set to zero at the end. This works fine for GL_PRIMARY_COLOR_NV, GL_SECONDARY_COLOR_NV, GL_FOG, GL_TEXTURE1_ARB, but NOT GL_TEXTURE0_ARB!!!
Instead, it comes out black (i.e. Nothing). I am certain that I enable texture0, because if I just comment out the glEnable for the combiners, it works fine, and I see both textures on my geometry.
If anyone has an idea why I can’t see texture0, please let me know.
Thanks,
Zeno