Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question No pixel art game occasional tilemap seams

Discussion in '2D' started by SwingWren, Jul 4, 2023.

  1. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    30
    In our game we have 2d art and 2d tile-maps with orthographic camera that zooms in and out during gameplay. The assets are configured with bilinear filter in the sprite atlas and with mipmapping enabled. This solution works for us but there are very occasional seams in our tilemaps (when moving the camera very occasionally one line crossing all tile layers and showing what's behind will show up).

    I've tried everything that I can think of and could find: adding more padding to tiles, changing cell gaps, disabling/enabling anti aliasing, camera movement, disabling mipmapping....

    My question is then: Is this unavoidable for our current setup?

    Edit: sample project https://github.com/SwingWren/2d-ocasional-tile-seams-demo
     
    Last edited: Jul 4, 2023
  2. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    • How did you add the padding?
    • What is the content of padding?
    • Is the camera significantly zoomed out when seams appear?
     
  3. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    30
    I was just creating a sample project, easier to see and change https://github.com/SwingWren/2d-ocasional-tile-seams-demo. Just press play and wait for the red lines to appear (the color of the camera background), you may need to be patient as sometimes it takes more times for the lines to show up.
     
  4. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    normally atlas with padding = 2 solves this problem

    however you using bilinear filter and mip maps might be messing with the solution

    maybe try increasing padding to an unreasonable amount like 10, or 20, see what happens
     
  5. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    30
    It doesn't seem to help, either with minmaps or without minmaps enabled
     
  6. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    30
    As you can see the padding is added through sprite atlas.
    The seams appear regardless of the zoom