Jump to content
  • Advertisement
Sign in to follow this  
stevengarcia

OpenGL Alpha Blending Artifacts

This topic is 3657 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 having an issue with a simple OpenGL program I have made for a class. I am trying to simulate waving grass by applying a .tga texture (w/ alpha chaneel) to an animated quad. However, when I apply the texture you can see the edges of the quad faintly outlined. I was just wondering if anyone had run into a similar problem and if there are any fixes for this. Additionally, when I apply my textures (.bmp) to my skybox you can again faintly see the edges of the box. Any ideas or hints are much appreciated. I have included a picture of my program running so you can see what I mean. Photobucket

Share this post


Link to post
Share on other sites
Advertisement
Hello there,

To fix your skybox, it's as simple as setting up the texture wrap to clamp:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

You can do the same for your tree textures. Also, try to make sure that the tree image has a 1 pixel boundary at all edges set to transparent. The artifacts are due to linear texture filtering - it's sampling from the opposite side of the texture.

Jeremiah

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!