opengl Multitexture problem

Started by
3 comments, last by DaAnde 16 years, 3 months ago
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?
Advertisement
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);
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);
Best Regards,KumGame07
Beautiful...After I finish drawing my terrain just before i call glPopMatrix(); I set this glActiveTextureARB(GL_TEXTURE0_ARB); and everything now works...thank you very much! You have helped me not get a huge headache with such a quick fix!
Image Hosted by ImageShack.us

This topic is closed to new replies.

Advertisement