Silver
04-11-2004, 09:03 AM
Hello!
I have written a C-Program under Linux, which should contain a ground with a texture on it, and a box which is multi-textured (with 2 textures)!
The problem is, that it doesn't show the ground. I guess, OpenGl thinks that the floor-texure is the third texture unit.
Here the texture-initialization code:
glBindTexture(GL_TEXTURE_2D, BOXTex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(..);
glBindTexture(GL_TEXTURE_2D, BOX2Tex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(...);
glBindTexture(GL_TEXTURE_2D, FLOORTex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(..);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BOXTex->ID); // bind to TU 0
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BOX2Tex->ID); // bind to TU 1
But the FLOOR-texture is always drawn on the box, although i passed the right positions of the vertices.
hyh!
I have written a C-Program under Linux, which should contain a ground with a texture on it, and a box which is multi-textured (with 2 textures)!
The problem is, that it doesn't show the ground. I guess, OpenGl thinks that the floor-texure is the third texture unit.
Here the texture-initialization code:
glBindTexture(GL_TEXTURE_2D, BOXTex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(..);
glBindTexture(GL_TEXTURE_2D, BOX2Tex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(...);
glBindTexture(GL_TEXTURE_2D, FLOORTex->ID);
glTexParameteri(..);
gluBuild2DMipmaps(..);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BOXTex->ID); // bind to TU 0
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BOX2Tex->ID); // bind to TU 1
But the FLOOR-texture is always drawn on the box, although i passed the right positions of the vertices.
hyh!