Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

diffuse shader causes seams between tiles

Discussion in '2D' started by geplourde, Jun 6, 2017.

  1. geplourde

    geplourde

    Joined:
    May 31, 2017
    Posts:
    23
    [seam in-game](https://i.stack.imgur.com/J0VVz.png)



    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.
     
  2. GameDevGuy

    GameDevGuy

    Joined:
    Nov 4, 2012
    Posts:
    96
    Me again =)

    I'm thinking you are gonna have to get your hands dirty with shader code. If it were me, my process would be:

    1. Create a simple tilemap with three of the images form the texture set, reproduce the error, fiddle with the actual art assets until the seam went away.

    2. If that doesn't work, try to debug the diffuse shader and see if you can find the clamp/gap issue

    3. Try another sprite shader that supports lighting, like http://esotericsoftware.com/forum/Sprite-Shaders-for-Unity-5838

    4. Try to add lighting to the Sprite shader

    I have a strong feeling the art might be the problem, but hopefully you won't have to get to steps #3 and #4. Is tiled2Unity free? If so, are you comfortable with sending me a very simple project with a sample scene using a basic tilemap and some of your art? I'm more of a hands-on debugger. Feel free to PM me.