Jump to content
  • Advertisement
Sign in to follow this  
BennettSteele

OpenGL Lines appear on textures with different screen resolutions?

This topic is 2208 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 before i was developing my game on a laptop with 1024x768 resolution, and whenever i tested it on another computer lines appeared as if OpenGL was taking my GL_QUADS calls and turning them into triangles. This creates lines that dissect the quad through the middle. I am using GL_LINEAR as one of the texture parameters, but i don't think that should matter.

Picture related, it shows the corner of the skybox showing lines appearing.

Share this post


Link to post
Share on other sites
Advertisement
Conversion to triangles should be expected behaviour as GPUs won't support quads in hardware.

What are you using for your texture wrap modes? Repeat? Clamp? Clamp to edge? The only one of these that's really valid for a skybox is clamp to edge. You can also alleviate a lot of problems with skybox drawing by using a cubemap texture instead of 6 individual textures, so that's another option for you if you're not already doing so.

Share this post


Link to post
Share on other sites
Im using the default, because i am not specifying a type of wrapping/clamping. Im also using 6 sub-regions of 1 texture. I have never used cubemaps, but it sounds like cubemaps are more efficient than 6 individual quads.

Share this post


Link to post
Share on other sites
This

I am using GL_LINEAR as one of the texture parameters,

+

Im also using 6 sub-regions of 1 texture

is your problem.
When using a texture atlas (put multiple sub-textures on a single texture) + using linear filtering + using exact texture coordinates, the linear filtering considers neighbor pixels at the borders. When your neighbour pixels are i.e. black, you will get an ugly line. The effect will increase with mipmapping, that is, when decreasing the screen resolution or moving father away lower mipmaps will be taken, which result in an more obviously border.

The best solution for skyboxes are cubemaps, as mhagain already said. Edited by Ashaman73

Share this post


Link to post
Share on other sites
Well i tested some of the methods, but it does not work. i'm going to try to use triangles instead of quads to see if it removes the lines.

EDIT:
http://stackoverflow...is-out-of-quads

found this. I will be taking a look at it.



EDIT 2:

the problem is calling glEnable(GL_POLYGON_SMOOTH); For some reason, this causes OpenGL to have lines in between the triangles.

So im going to not use this since it causes problems. Edited by bennettbugs

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!