I currently have a scene where it must add a fixed color value to texture # 1 and then modulate with primary color as texture # 2. Now for some reason, this fails on the Geforce4 MX 4000 card and the result ends up as full white.
To demonstrate what I am trying to accomplish, here’s the code used to do the texture combining:
float f[4];
f[0] = 1.0f; f[1] = f[2] = f[3] = 0; // red color
// setup texture pass 1
glActiveTexture(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
// add red constant color to texture
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, f);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE0_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_CONSTANT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
// setup texture pass 2
glActiveTexture(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
// modulate previous result to primary color
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PRIMARY_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
This works for all cards tested EXCEPT for the Geforce4 MX 4000 which the result always ends up as full white. I’ve checked online and saw that this card supports ARB combiner and multitexturing extensions. So what gives? Is it possible that I may be doing something wrong that only this card is detecting?