PDA

View Full Version : Cube Mapping bug in NVIDIA driver?



Diapolo
05-01-2001, 12:16 PM
Im using NVIDIA GF2 GTS 32 MB and driver version 11.01 (unofficial) in an Win98SE environment and I set up cube mapping.

If I do the following:

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
SetTexEnv(2, GL_REPLACE);

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);

glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
SetTexEnv(1, GL_MODULATE);

"draw geometry";

glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);

glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

"print text to screen with texfont";

Then the text output is messed up and unreadable and it has got to do with the texture mapping. If I start the above code with:

glPushAttrib(GL_TEXTURE_BIT);

and let it end with an:

glPopAttrib();

and then try to print text it works like it should.

Does anyone see a fault in my code or could it really be a driver problem.

Oh and by the way, if I redraw my geometry after disable texcoord-gen, I still see Cube Mapping ...

Regards,
Diapolo

Diapolo
05-01-2001, 12:20 PM
I tried disabling TMU1 before TMU0, but still the same error ...

Regards,
Diapolo

Diapolo
05-01-2001, 12:28 PM
I found the (STUPID) error:

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
SetTexEnv(2, GL_REPLACE);

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);

glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
SetTexEnv(1, GL_MODULATE);

"draw geometry";

// Here was the mistake!
// I tried disabling texcoord gen for
// GL_TEXTURE1_ARB, because GL_TEXTURE0_ARB
// was not the active one.
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

"print text to screen with texfont";

Now everything works without the Push / Pop Attrib calls.

OpenGL is a state machine, remember *G*!

Regards,
Diapolo

[This message has been edited by Diapolo (edited 05-01-2001).]