opengl Multitexture problem
I am writing an engine for a game I am making for fun. I had everything working like models loading and getting textured and everything. My terrain looked crappy so I improved that by using multi texturing. Now all my other texturing is broken ie. Not showing up. Is there any way to change between using multi texturing and using single textures?
EDIT: To further clarify what I mean. The code I use to render terrain textures is for example:
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, TextureArray[0]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, TextureArray[1]);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, tCoord[x][z][0], tCoord[x][z][1]);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0, 0);
To render every other texture in my game I use for example:
glBindTexture(GL_TEXTURE_2D, texture);
glTexCoord2f(1.0f, 1.0f);
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, TextureArray[0]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, TextureArray[1]);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, tCoord[x][z][0], tCoord[x][z][1]);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0, 0);
To render every other texture in my game I use for example:
glBindTexture(GL_TEXTURE_2D, texture);
glTexCoord2f(1.0f, 1.0f);
Quote:
To render every other texture in my game I use for example:
glBindTexture(GL_TEXTURE_2D, texture);
glTexCoord2f(1.0f, 1.0f);
Now the active texture unit is UNIT_1 if you did not change the current texture unit and
glTexCoord2f(1.0f, 1.0f);
will set the texture coordinates of UNIT_0. So before setting the texture coordinates make UNIT_0 the active unit.
glActiveTextureARB(GL_TEXTURE0_ARB);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement