Jump to content
  • Advertisement
Sign in to follow this  
Tiresias

OpenGL black borderof 2 texture when scaling

This topic is 3043 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

Hello i am using openg for 2d only textures.l my texture are png files. I noticed at some scale there i a small black line located at the bottom border of the png (it seems to blink). it is not a big problem but is a bit ugly. with no scale no issue. Most of the scales are ok, only some value are messing opengl. here is my code for the texture. creation: glBindTexture(GL_TEXTURE_2D, work->textureID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, work->w, work->h , 0, GL_RGBA, GL_UNSIGNED_BYTE, work->data); and then during blitting there is a translate(), a scale() if new dim are not the same than original png dim, and a simple begin() end() with vertex stuff.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!