Jump to content
  • Advertisement
Sign in to follow this  
O-san

Vertex seams

This topic is 2614 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

Hello!

I got a vertex edge artifact in my scene which I mostly just ignored. I am rendering an orthographic scene with images as various objects. Each object is its own glDrawElement. I align the objects so they should make a nice solid wall but sometimes there are edges visible between them. Can this be prevented without merging all of the objects into one glDrawElement call? I am quite certain it is a float precession error, would it maybe help if I enlarged my scene and used GLint instead of GLfloat? Right now I need 0.5 accuracy but I guess I could enlarge the graphics and use integers instead. Any thought are welcome.

seams.png

The seam is visible on the corner of the building.

Share this post


Link to post
Share on other sites
Advertisement
is that line on a seam between two triangles/primatives that are not sharing vertices?

is the texture mipmapped?

Are you using GL_CLAMP or GL_CLAMP_TO_EDGE?

Share this post


Link to post
Share on other sites
Thanks for the reply. The triangles does not share vertices but they are at the same location (floats). They are two separate drawing calls. There is no mipmaping and I use GL_CLAMP_TO_EDGE.

Share this post


Link to post
Share on other sites
Try removing any T-junctions and make the triangles share vertices, and see if you can still get the artifact.

Are your graphics drawn at exactly 1:1 size?
If not, GL_CLAMP_TO_EDGE is not necessarily correct, especially not if you use bilinear filtering, as you don't actually want the edge to clamp, you want it to filter into the texels of the corresponding border of the neighboring tile.
If you want perfect 2D graphics it's usually easiest to draw everything at exact pixel-positions and 1:1 sizes, and if needed scale the whole scene afterwards. If you don't want that, try wrapping instead of clamping and see how it looks like then. Are all your graphics their own textures, or do you use texture atlases?

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!