Ok, here we go. This is what I have thus far, I havent had a change to compile it yet, so I have NO idea if it works. Is this similar to what you all were talking about? I am very curious as to how I would get rid of using the Inverted bump map. Could one of you please show me where in the code I would need to change something, and what, in order to remove that particular piece. Also would that remove the need for the second pass???
//Texture 0
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BumpImage);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);
//Texture 1
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, InvertedBumpImage);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD);
// General Switches
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
//Setup Vertex info
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, &Map.VertPT);
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 0, &Map.NormalPT);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, &Map.TextureBasePT);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, &Map.TextureBumpPT);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
//Draw first pass
glLockArraysEXT(0, Map.NumVerts);
glDrawElements(GL_TRIANGLES, 0, GL_UNSIGNED_INT, &Map.VertIndexPT);
glUnlockArraysEXT();
//Reset texture information
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D,BaseImage);
glBlendFunc(GL_DST_COLOR,GL_SRC_COLOR);
//Turn stuff back on
glEnable(GL_BLEND);
glEnable(GL_LIGHTING);
//Resetup Vertex info
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, &Map.VertPT);
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 0, &Map.NormalPT);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2, GL_FLOAT, 0, &Map.TextureBasePT);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
//Redraw
glLockArraysEXT(0, Map.NumVerts);
glDrawElements(GL_TRIANGLES, 0, GL_UNSIGNED_INT, &Map.VertIndexPT);
glUnlockArraysEXT();
I run the all the verts though a function that finds the offset of each texture coord and saves the total of the old tex coord, and the distance moved into the array pointed to by Map.TextureBumpPT, so that is where i get the ofset values from.
[This message has been edited by dabeav (edited 06-28-2002).]