Lines appear on textures with different screen resolutions?

Started by
4 comments, last by BennettSteele 11 years, 8 months ago
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.
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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

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.
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.
Thanks. I will be fixing that, and reporting back with the results.
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.

This topic is closed to new replies.

Advertisement