Aeluned,
Well I tried that… Below I’ve included the code that I’m using. Currently it will render the GL_QUADS with both (2) textures.
If I replace glBegin( GL_QUADS );…glEnd(); code with just a simple gluSphere(…) it will only apply the first texture (not both).
if (bRenderedGround) { // Draw a rendered ground
glColor4f(1.0, 1.0, 1.0, 1.0);
glPushMatrix();
// 1st Texture Unit
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureArray[GROUND]);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
// 2nd Texture Unit
if (detail) {
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);// Combine mode
glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2);
glBindTexture(GL_TEXTURE_2D, textureArray[GROUND+1]);
// Now we want to enter the texture matrix. This will allow us
// to change the tiling of the detail texture.
glMatrixMode(GL_TEXTURE);
// Reset the current matrix and apply our chosen scale value
glLoadIdentity();
glScalef((float)8, (float)8, 1);
// Leave the texture matrix and set us back in the model view matrix
glMatrixMode(GL_MODELVIEW);
}
glPushMatrix();
glNormal3f(0, 1, 0);
glBegin( GL_QUADS ); // Draw the ground.
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 0.0f, 0.0f );
glMultiTexCoord2fARB( GL_TEXTURE1_ARB, 0.0f, 0.0f );
glVertex3f( -100, 0.0, -100 );
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 0.0f, 1.0f );
glMultiTexCoord2fARB( GL_TEXTURE1_ARB, 0.0f, 1.0f );
glVertex3f( -100, 0.0, 100 );
glFogCoordfEXT( 0.0f);
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 1.0f, 1.0f );
glMultiTexCoord2fARB( GL_TEXTURE1_ARB, 1.0f, 1.0f );
glVertex3f( 100, 0.0, 100 );
glMultiTexCoord2fARB( GL_TEXTURE0_ARB, 1.0f, 0.0f );
glMultiTexCoord2fARB( GL_TEXTURE1_ARB, 1.0f, 0.0f );
glVertex3f( 100, 0.0, -100 );
glEnd();
glPopMatrix();
}