Thin lines at Polygon edges - OpenGL

Started by
6 comments, last by M2tM 15 years, 3 months ago
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...
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.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

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.


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.
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]

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Set the near clipping plane to 0.1f.
Your value is far too small I think.
www.bug-soft.net
Thank you so much swiftcoder... that fixed it.
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.
_______________________"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk

This topic is closed to new replies.

Advertisement