Jump to content
  • Advertisement
Sign in to follow this  
ic0de

OpenGL Multiple textures are mixing problem

This topic is 2568 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So i'm using multitexturing in opengl and it appears to work except that the textures are blending colors even where they aren't overlapping.

My textures are being bound like so.




for(int lnum = 0; lnum < numtextures; lnum++)
{
glActiveTexture(GL_TEXTURE0 + lnum);
glBindTexture(GL_TEXTURE_2D, tex[0] + lnum);
glEnable(GL_TEXTURE_2D);

glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
}



How can I blend them only in places where two textures are overlapping?

Share this post


Link to post
Share on other sites
Advertisement
Perhaps your textures should have a white border and also use GL_CLAMP_TO_EDGE.
If you will be using the border feature of glTexImage2D, then it would be GL_CLAMP_TO_BORDER.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!