PDA

View Full Version : Reg Combiners ... Part II



Shag
03-07-2002, 09:31 PM
OK ... The black and white stuff works fine, but how do I get lighting to work?




float Grey[4] = {0.3f,0.59f,0.11f,1.0f};

glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV ,1);
glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, Grey);

glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_A_NV,GL_TEXTURE0_ARB,GL_UNSIGNED_IDENTITY_NV,GL _RGB);
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_B_NV,GL_CONSTANT_COLOR0_NV,GL_UNSIGNED_IDENTITY _NV,GL_RGB);
glCombinerOutputNV(GL_COMBINER0_NV,GL_RGB,GL_SPARE 0_NV,GL_DISCARD_NV,GL_DISCARD_NV,GL_NONE,GL_NONE,G L_TRUE,GL_FALSE,GL_FALSE);


This produces a nice B&W image, but disables lighting ... where do I go from here?

Regards

Shag
03-08-2002, 02:16 AM
I've found a solution ...




glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV ,1);
glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, Grey);

glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_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_PRIMARY_COLOR_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);