Jump to content
  • Advertisement
Sign in to follow this  
lord_balron

Thin lines at Polygon edges - OpenGL

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

So I'm having a problem with my skybox in my opengl program where I am getting very thin lines at the edges of the quads. Seen in picture below. Image of lines Apart from slightly increasing the polygon size (which is a lot of numbers), I don't know what to do, its also worth noting that the textures do not have a thin line around them, they are fine. I'm at a loss...

Share this post


Link to post
Share on other sites
Advertisement
I had a similar issue. Try out different filtering types, or offset the texture coords by a tiny amount (0.0001 or something), that fixed it for me.

Share this post


Link to post
Share on other sites
Off the top of my head, there are two possibilities I can think of.

1. A texture smoothing problem where pixels outside the rendered area get blended into the rendered area. This is likely if you're using one image (with six parts) for the entire skybox texture. The solution would be to use six separate textures and make sure the texture repeat mode is set to GL_CLAMP. If you're already using six separate textures, though, do what deadstar says and change the tex coords by a very small amount.

2. A depth buffer imprecision issue. This could especially be true if you're drawing anything outside of the skybox. Solution: increase the Near distance for the perspective view. I've never had this problem looking at inside edges of a box-shaped object, though, only outside ones.


Share this post


Link to post
Share on other sites
Well, I am using 6 seperate textures, and I'm not drawing anything outside of the box, its only black space.

My depth buffer near clipping is set at 0.001f... so I'm not sure what to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by Futurulus
Make sure the texture repeat mode is set to GL_CLAMP.
You shouldn't use GL_CLAMP - instead use GL_CLAMP_TO_EDGE.

GL_CLAMP is a bit of a misnomer, as it doesn't clamp to anything useful [smile]

Share this post


Link to post
Share on other sites
To expand on swiftcoder's comment GL_CLAMP is improperly implemented on some graphics cards which gives it the same effect as GL_CLAMP_TO_EDGE. This caused me trouble way back when I started viewing some of my first graphical apps on other computers.

Typically though you want to use GL_CLAMP_TO_EDGE.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!