PDA

View Full Version : Texture Combiner Issues with Specific Video Card



SamKV
02-06-2012, 08:57 PM
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?

BionicBytes
02-07-2012, 04:30 AM
Geforce4 MX 4000 is very old - produced back in 2002.
Have you checked that there is a newer driver than the one you are currently using? Perhaps look in the driver archives.
It does seem likely to be a bug if it's working else where.
Incidently, what other h/w have you checked against?

SamKV
02-07-2012, 09:32 AM
Incidently, what other h/w have you checked against?

According to the users who were using my app, they all said that it's from that specific video card and never experienced any issue with other cards. Though they only tested against 3 other cards (forgot the names). The code is for a N64 emulator which ironically, has texture combiner capabilities. If something like that is capable of doing texture combining back in 1997 then you think a 2002 video card could do the same thing.

BionicBytes
02-07-2012, 10:01 AM
nNidia usually produce rock-solid drivers, and have done for a very long time.
I never did get my head around combiners so I can't say for sure if there is anything wrong. It just seems odd that only this specific nVidia card is wrong - other nVidia cards are OK?

I do know the Gf4 MX was a cut-down card with reduced functionality, so it is possible the drivers for this particular card is lacking somthing important. Just a guess.

mhagain
02-07-2012, 10:29 AM
If something like that is capable of doing texture combining back in 1997 then you think a 2002 video card could do the same thing.

Normally you would but the GeForce 4 MX is a special case. It's not really a GeForce 4 and was actually a lower performer with a lower feature spec than the preceding GeForce 3 - only 2 texture units, no shader support, very weak: http://en.wikipedia.org/wiki/GeForce_4_Series#GeForce4_MX

I don't think it would be unreasonable to request your users to upgrade in this case.