After trying for the last two weeks I have only a white screen with a faint outline of my image to show for my attempts at multipling two textures together with ARB_multitexture. #^$%!!! I originally multiplied the two together using multipass like this:
// bind diffuse texture
glBindTexture( GL_TEXTURE_2D, _texName[0] );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
GL_BGRA_EXT, GL_UNSIGNED_BYTE, pDiffuseImage );
// bind bump texture
glBindTexture( GL_TEXTURE_2D, _texName[1] );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA8, width, height, 0,
GL_ALPHA, GL_UNSIGNED_BYTE, pBumpImage );
> … <
// Pass 1: diffuse
glBindTexture( GL_TEXTURE_2D, _texName[0] );
glCallList( quad );
// Pass 2: bump map
glBlendFunc( GL_ZERO, GL_SRC_ALPHA ); // thank you j
glEnable( GL_BLEND );
glBindTexture( GL_TEXTURE_2D, _texName[1] );
glCallList( quad );
glDisable( GL_BLEND );
Perfect.
However when I converted the second chunk of code to do multitexture like this:
glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable( GL_TEXTURE_2D );
glEnable( GL_BLEND );
glBlendFunc( GL_ONE, GL_ZERO );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
glBindTexture( GL_TEXTURE_2D, _texName[0] );
glActiveTextureARB( GL_TEXTURE1_ARB );
glEnable( GL_TEXTURE_2D );
glEnable( GL_BLEND );
glBlendFunc( GL_ZERO, GL_SRC_ALPHA );
glBindTexture( GL_TEXTURE_2D, _texName[1] );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
glBegin( GL_QUADS );
glColor3f( white );
glNormal3f( 0.0f, 0.0f, 1.0f );
// four sets of these in counter-clock wise order
glTexCoord2fv( k_TexCoord[n] );
glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, k_TexCoord[n] );
glVertex2fv( k_VtxCoord[n] );
glEnd( );
// Disable blending & texturing for tex units 0 & 1.
Result: white screen and a faint image.
Lights off. Backface culling off. Depth testing off. Alpha testing off. ARB_multitexture extension confirmed supported on my Geforce MX under Win2000 o/s.
Please help. How can I do this without using any other extensions?