Sign in to follow this  
Tiresias

OpenGL black borderof 2 texture when scaling

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this