Jump to content
  • Advertisement
Sign in to follow this  
riruilo

OpenGL Strange texture borders. I guess because of GL_TEXTURE_WRAP_S

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

Hi friends! Using Qt 4.5 and VS2005, OpenGL widget and a PNG texture with alpha channel, I see strange borders and I guess it is because bilinear filtering (I guess when filtering a borders, the method takes just the another border pixels also.) I change GL_TEXTURE_WRAP_S from GL_REPEAT to GL_CLAMP, and although it is better, I still see artifacts in my object borders. And if I set filtering to GL_NEAREST there are no artifacts. I read this on opengl docs: "GL_TEXTURE_WRAP_S Sets the wrap parameter for texture coordinate s to GL_CLAMP, GL_REPEAT, GL_CLAMP_TO_BORDER_EXT, or GL_CLAMP_TO_EDGE_EXT. GL_CLAMP causes s coordinates to be clamped to the range [0, 1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. GL_REPEAT causes the integer part of the s coordinate to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. GL_CLAMP_TO_BORDER_EXT causes s coordinates to be clamped to a range 1/2 texel outside [0, 1]; this prevents the "half border, half edge" color artifact. GL_CLAMP_TO_EDGE_EXT causes s coordinates to be clamped to a range 1/2 texel inside [0, 1]; this prevents any border colors from showing up in the image. Border texture elements are accessed only if wrapping is set to GL_CLAMP or GL_CLAMP_TO_BORDER_EXT. Initially, GL_TEXTURE_WRAP_S is set to GL_REPEAT." But it seems Qt does not support GL_CLAMP_TO_BORDER_EXT . Any idea or suggestion? Thanks in advance! Image Hosted by ImageShack.us<br/>

Share this post


Link to post
Share on other sites
Advertisement
qt should support GL_CLAMP_TO_BORDER_EXT I dont see why not,

u can change border colors check the spec for the method the default color is black (what u see there)

what you should try is GL_CLAMP_TO_EDGE, since GL_CLAMP_TO_BORDER will give you a black border which is not what you want

Share this post


Link to post
Share on other sites
Quote:
Original post by ricardo_ruiz_lopez
But it seems Qt does not support GL_CLAMP_TO_BORDER_EXT .


How are you reaching that conclusion? Qt doesn't implement OpenGL, neither wraps it, QGLWidget just gives you a way to create a OpenGL context in a cross-platform way.

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!