   Blending with ARBmultitexture?
  I want to make a model with blinking lights, and I'm busy trying to get the blinking of the lights working.Using GL_SRC_ALPHA, GL_ONE and applying a sin to the alpha channel I got blinking lights working with two passes.Now I'm trying to transfer this to multitexturing, but I can't get it. I've looked for reference materials on ARBMultitexture, but haven't been able to find much, and certainly not much on blending the two (or more) textures together.Could someone point me in the right direction.Here's the code for two passes glDisable(GL_BLEND);  glEnable(GL_DEPTH_TEST);  glEnable(GL_TEXTURE_2D);  glBindTexture(GL_TEXTURE_2D, texture1);  glPushMatrix();glBegin(GL_QUADS);glTexCoord2f(0.0f, 1.0f);    glVertex3f(-1, 1, 0);glTexCoord2f(0.0f, 0.0f);glVertex3f(-1, -1, 0);glTexCoord2f(1.0f, 0.0f);glVertex3f(1, -1, 0);glTexCoord2f(1.0f, 1.0f);glVertex3f(1, 1, 0);glEnd();  glPopMatrix();  glColor4f(1.0, 1.0, 1.0, currentAlpha);  glEnable(GL_BLEND);  glDisable(GL_DEPTH_TEST);  glBlendFunc(GL_SRC_ALPHA, GL_ONE);  glBindTexture(GL_TEXTURE_2D, texture2);  glPushMatrix();glBegin(GL_QUADS);glTexCoord2f(0.0f, 1.0f);    glVertex3f(-1, 1, 0);glTexCoord2f(0.0f, 0.0f);glVertex3f(-1, -1, 0);glTexCoord2f(1.0f, 0.0f);glVertex3f(1, -1, 0);glTexCoord2f(1.0f, 1.0f);glVertex3f(1, 1, 0);glEnd();  glPopMatrix();And here's my code for multitexturingglActiveTextureARB(GL_TEXTURE0_ARB);    glEnable(GL_TEXTURE_2D);  glBindTexture(GL_TEXTURE_2D,  texture1);    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);  glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);    glDisable(GL_BLEND);  // Set the second texture ID to be active, then bind our light map texture to this ID.  glActiveTextureARB(GL_TEXTURE1_ARB);  glEnable(GL_TEXTURE_2D);  glBindTexture(GL_TEXTURE_2D,  texture2);    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);  glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD);    glEnable(GL_BLEND);    glBlendFunc(GL_SRC_ALPHA, GL_ONE);  glPushMatrix();glBegin(GL_QUADS);glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f, 1.0f); glVertex3f(-1, 1, 0);glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f, 0.0f);glVertex3f(-1, -1, 0);glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f, 0.0f);glVertex3f(1, -1, 0);glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f, 1.0f);glVertex3f(1, 1, 0);glEnd();  glPopMatrix();[edited by - rick_appleton on July 18, 2003 7:38:00 PM]
  The information your looking for isnt in the ARB_Multitexture spec, but rather in the ARB_Env_combine spec. ;  I don't think you should be using GL_REPLACE on the second texture, it just overwrites the first one.  Try GL_MODULATE or GL_LUMINANCE.  Also your other setup lines may also be wrong.Buy "OpenGL Game Programming" it's really good and explains all this.   ---"When I'm in command, every mission's a suicide mission" - Zapp Branigan   [edited by - theZapper on July 18, 2003 6:52:54 AM];  you''re right, I accidentally copied the wrong lines into the code here, I do actually have GL_MODULATE for the first texture (so I get shadows), and GL_ADD for the second texture unit, but this is not what I need.what I need is this:ColorOfTarget = ColorOfSourceFragment + Alpha*TextureColorI''ve found some good info on the glTexEnv function, but I  can''t find the option I need. Does it exist, and am I unable to find it, or does it not exist?I should add, that at the moment the second texture does not have an alpha layer, and I would like to keep it that way. So I want to specify the alpha value with a glColor4f(1.0, 1.0, 1.0, alphaValue) ;  Ok, try this.http://www.gametutorials.com/download/OpenGL/MultiTexturing_OGL.zip   ---"When I''m in command, every mission''s a suicide mission" - Zapp Branigan ;  thanks for the link, but I already looked at it and it is no help. It only says that in some future tutorial they will go into the EXT_texture_env_combine. But they don''t use it here. ;  does anyone else have an idea?I just can''t believe that a certain effect as simple as this can only be achieved in two passes, and not with multitexturing. ;  Have you read the ARB_texture_env_combine spec?When you enable it, you must specify which sources you want to use, and then the operation you want between themin your code at the top you only enables it and specifies an operation, but you dont specify the sources you want to work on.