PDA

View Full Version : REPLACE acts as MODULATE????



wis mak
09-12-2002, 03:06 AM
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.

vincoof
09-12-2002, 04:44 AM
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) ?

SirKnight
09-12-2002, 06:28 AM
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

wis mak
09-13-2002, 08:55 AM
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.

vincoof
09-13-2002, 09:35 AM
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).]