Jump to content
  • Advertisement
Sign in to follow this  
webjeff

gl_texture_mag_filter gl_linear causing artifacts

This topic is 4726 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, When I use glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR) I am seeing a 1 pixel white dotted line on the right side of my image. Its a 32 bit image with alpha. When I use GL_NEAREST it shows up fine, with no artifacts on the side but its a little blocky cause I am scaling it up a little bit. So I need Linear, but how do I remove that white dotted line on the right side, its small but is noticable. I have tried also using GL_CLAMP to clamp the image, but that doesn't help either. Any ideas? Jeff.

Share this post


Link to post
Share on other sites
Advertisement
The hard way: change the image data so all of the zero alpha values still retain the colour of the near-by pixels (rather than black (or white in this case)).

The easy way: increase the minimum cut-off for the alpha values using glAlphaFunc().

Share this post


Link to post
Share on other sites
Well, ok, can you help with the alpha func. I have tried glAlphaFunc(GL_ALWAYS,0.5);

But that didn't work. Am I using that function wrong?

Thanks
Jeff.

Share this post


Link to post
Share on other sites
Using GL_ALWAYS will make every pixel get rendered, regardless of the alpha value (as it says on the page I linked you to). Try glAlphaFunc(GL_GREATER,0.5f).

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.

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

Sign me up!