Lines appear between tiles of generated mesh

Alright, so here’s my problem. I have a 2d randomly generated mesh that is made of 16px x 16px tiles (they are mapped off a texture atlas, not individual gameobjects). When I run the game I experience bleeding/tearing/whatever you’d like to call it. Below is a screenshot.


I tried going into settings and turning off anti-aliasing but that only solved the problem when the camera was stationary. (Since I cannot include any more attachments I will just try my best to explain this one) When I moved the camera around, the horizontal and vertical lines would flicker.

When I moved the camera, the tearing returned. Finally, I tried turning on pixel snapping (shown in below screenshot) and it solved the problem when the window was not maximized (in editor and build).


I honestly have no idea what is going on. If you need any additional info or screenshots just ask. Thanks.

EDIT: I was looking at pixel snap some more and now I’m really wondering why when I build it with the display set to full screen it runs fine, same when windowed but not fully maximized. When built, the only time there is an issue is when it is in windowed mode and maximized. Not much else to say other than I am confused.

You may have to use the gutter technique which is what I had to do in order to avoid these lines flickering as the camera moved. A gutter is a few pixels thick that surrounds the perimeter of the tile/sprite and is just a mirror of the original tile’s perimeter. I’d create a gutter of 4 pixels just to be safe. So, in the end, your tiles will be 20x20 even though they are laid out on a 16x16 grid, and the added gutter only appears visible where the flickering lines used to be, removing the problem entirely.

Disable MipMaps if you have them enabled

Have you checked your texture uv mappings ? if the image texture image is mapping to its edge this could happen. or sometime turning warp mode of the texture to clamp will fix your problem.