REPLACE acts as MODULATE????

When I render a textured polygon and change the vertex color to different than full intensity white, the texture is modulated with this color knowing that texture env mode is replace. What is wrong? I have the latest driver for my GeForce 2 MX.

Please post code of your texture environment calls.

Meanwhile, answer those questions please :

  • which OpenGL version is supported by your drivers ?
  • do you use multitexturing ?
  • have you called glGetError to retrive the GL error(s) ?

Hmmm, that’s pretty odd. If you say you do have the latest drivers it should work. GL_REPLACE is only supported in OpenGL 1.1 and higher and the newest drivers are OpenGL 1.4. Trying doing a glGetString call with GL_VERSION as the parameter and see if you get something higher than 1.1. Also try a glGetError right after your glTexEnv call and see what that gives you.

-SirKnight

I have GeForce 2 MX with OpenGL 1.3 drivers installed. I’m pretty sure of this.
I infact use code like this to set TMU0 to replace env mode:

glActiveTextureARB(GL_TEXTURE0_ARB);
glTexEnvf(…, …, GL_REPLACE);

and it still modulates color specified by glColor with the texture.

Are you sure the texture unit is enabled ?
If this unit is disabled, then maybe you’re using another texture unit (which would have been set to MODULATE).

Also, have you called glGetError to retrieve if the GL “accepted” the line ?

btw, I recommend glTexEnvi over glTexEnvf, that is :
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
(btw, please check what you set in the 2 first arguments of glTexEnv).

[This message has been edited by vincoof (edited 09-13-2002).]