Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lines appear on textures with different screen resolutions?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 bennettbugs   Members   -  Reputation: 493

Like
0Likes
Like

Posted 02 August 2012 - 05:39 PM

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.

Attached Thumbnails

  • weird lines.png


Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7823

Like
1Likes
Like

Posted 02 August 2012 - 06:10 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 bennettbugs   Members   -  Reputation: 493

Like
0Likes
Like

Posted 02 August 2012 - 07:56 PM

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.

#4 Ashaman73   Crossbones+   -  Reputation: 7122

Like
1Likes
Like

Posted 02 August 2012 - 11:23 PM

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, 02 August 2012 - 11:24 PM.


#5 bennettbugs   Members   -  Reputation: 493

Like
0Likes
Like

Posted 03 August 2012 - 10:11 AM

Thanks. I will be fixing that, and reporting back with the results.

#6 bennettbugs   Members   -  Reputation: 493

Like
0Likes
Like

Posted 03 August 2012 - 02:52 PM

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, 03 August 2012 - 03:16 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS