occasional vertical lines between tiles when using sprites>diffuse shader

What you are seeing is referred to as a “seam”. There are a lot of reason why you might see that. Could be do to:

  • Art (does the image have a transparent gap in it?)
  • Graphical settings (anti-aliasing on or off?)
  • Shader (bug with Sprite shader)
  • Game component (if that is a screenshot of two images, they may not be together enough)

Need more details about your setup of the scene and assets.

1 Like

I’ve been using tiled and tiled2unity to design and import my maps into Unity with no problem, as long as I stick to the default tiled2Unity shader or the sprites>default shader. However, I’ve been trying to implement lighting into the project and thus have to change the shaders to some form of diffuse. When I change the tiled maps shaders from anything other than the two mentioned above, I get these vertical lines between tiles. I took a screenshot of the problem and have linked it to this page. The problem is especially obvious when the camera moves. I tried sprites>diffuse, standard, and mobiles variants, all with the same vertical lines appearing. But when I turn it back to sprites>default or tiled2Unity>default, the problem disappears entirely (as long as I have pixel snap enabled). What is happening? I’ve scoured the internet and haven’t found any solutions.

Hmmm, so it could be a bug in your shader or a problem with the data from Tiled. Out of curiosity, what happens when you disable anti-aliasing?

1 Like

When I remove anti-aliasing I have the seams as seen in the original pic above. With anti-aliasing enabled I notice some more seams than before. I should’ve mentioned originally that these seams flickers as the camera position moves. Here is a picture with anti-aliasing enabled: 3096986--233763--2017-06-06 (4).jpg

Doing a search for “tiled2unity” + “seam” yielded some results (Google). I haven’t dug through them all, but here are some links with people having similar issues:
Pithy Pangolin Dev Blog — Unity2d sprite tile seem issues
Reddit - Dive into anything

1 Like

Thank you. I’ve seen those posts before and have tried a few of their suggestions, each without success. I will try more, but at this point it’s really a guessing game for me.

Dude Thank you so much!! I was finally able to solve the problem by adding a extrude layer around the tiles. I guess it’s an issue with unity itself, but by using TexturePacker and setting the extrude value to 1, the problem is solved. You were the only person to reply on a multitude of sites, I tip my fedora to you sir.

1 Like

Outstanding! Glad I was of some help. Good luck with the rest of your development!

i did all those things and still not working for me

You could try packing your Textures of your Tiles into one Sprite Atlas. This will help pad the Sprites of your Tiles when running your game in Play Mode.

I need help, why are there lines? They appear in my shader.