Sign in to follow this  
BennettSteele

OpenGL Lines appear on textures with different screen resolutions?

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
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[quote name='bennettbugs' timestamp='1343950758' post='4965678']
I am using GL_LINEAR as one of the texture parameters,
[/quote]
+
[quote name='bennettbugs' timestamp='1343959004' post='4965715']
Im also using 6 sub-regions of 1 texture
[/quote]
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:
[url="http://stackoverflow.com/questions/9314148/opengl-gl-polygon-smooth-2d-antialiasing-creating-tris-out-of-quads"]http://stackoverflow...is-out-of-quads[/url]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this