Advertisement

GL_EXT_texture_env_add

Started by September 30, 2003 05:14 PM
4 comments, last by Lyve 21 years, 5 months ago
Hello people, I''m testing my product on different platforms at the moment and I''ve got a problem with a system that is using an old Voodoo 3 graphics card. I want to render a textured face where an environment map is "added" onto it. With systems that support the GL_ARB_texture_env_combine extension I do it the following way:

// TU1 (default settings):

glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );

// TU2:

glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_ADD );
This is working well. So now I want to achieve the same effect on a Voodoo 3, without success. I tried it the following way:

// TU1 (default settings):

glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );

// TU2:

glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); // GL_ADD should work because I''ve tested for the extension GL_EXT_texture_env_add


However, this solution doesn''t work. All I get is a lit face that doesn''t have textured portions at all. Am I misunderstanding the GL_EXT_texture_env_add extension, or what am I doing wrong? Lyve _____________________________________ http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting!
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.
Do you use texture environment combining somewhere else in your code ? If so, take care of how you setup the input source and operands 0 and 1 for the second texture unit. Because OpenGL is a state machine, every call like that could yield to weird behaviour :
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PRIMARY_COLOR_ARB);

OTOH, do you use blending ? If so, how is configured the alpha stage of the texture environment combination ?
Advertisement
Thanks for your reply vincoof,

I''ve checked the things you mentioned. I''ve disabled blending to make sure nothing is going wrong with it. I also did a "find in files" for "glTexEnv" without success (no other lines than the ones posted). I''ve replaced the GL_ADD with GL_MODULATE only for testing, it works. Texture 1 is modulated by Texture 2. But if I insert GL_ADD, theres no texture at all
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.
It looks like a driver issue.

Granted that you don''t call glTexEnv anywhere else in your code, then, according to the specifications, the lines :
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_ADD);

are absolutely equivalent to :
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);

even if blending is enabled (I''ve checked alpha statement) and no matter the texture image format. It''s exactly the same. (the only issue you could get is invariance but it''s really another topic).

Have you tried other drivers for this card, or even drivers made by the same company but released sooner ?
the folowing used to work on my voodoo 3

glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, basetexture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, overtexture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
Indeed, your mode works here. However, if you set the first TU to GL_MODULATE, it doesn''t. So it seems to be a driver bug.
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.

This topic is closed to new replies.

Advertisement