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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Bug Bad interpolation in tilemaps?

Discussion in '2D' started by fakedev, Mar 23, 2023.

  1. fakedev

    fakedev

    Joined:
    Jan 14, 2023
    Posts:
    7
    I've got what appears to be an interpolation issue on tile maps. In order to illustrate it, I've done a minimal 2D URP Unity project (650 MiB).

    First, I've created a tileset of 9 64×64 tiles, with a white tile in the center and colored neighbours, with "point" filtering mode:


    Tilemap

    Then, I've created a tilemap made of white tiles only.

    However, vertical fushia and horizontal blue lines appear in both game window:


    Horizontal blue line and vertical fushia line in game window

    as well as in the scene window (zoom in):


    Horizontal blue line in scene window


    Vertical fushia line in scene window

    It happens in both 2021.3.17f and 2022.2.8f1 Unity versions, in both this minimal project and my game project.

    What did I make wrong? Is this a bug?

    How to get rid of these lines?
     
  2. flasker

    flasker

    Joined:
    Aug 5, 2022
    Posts:
    193
    create sprite atlas with padding = 2
     
  3. fakedev

    fakedev

    Joined:
    Jan 14, 2023
    Posts:
    7
    Do you mean change all the graphics of the game in order to include a 2 pixel wide padding between every tile in the tileset, then redo all the tilemaps of every level? o_O
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    9,414
  5. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    461
    If you use the unity builtin sprite atlas functionality you don't have to redo anything. All the references to sprites will remain correct. Unity will automatically detect that a sprite is in an atlas take image data from there. This is very convenient for adding little bit of extra padding or optimizing the memory usage without having to make any changes in original assets or workflow.
     
  6. flasker

    flasker

    Joined:
    Aug 5, 2022
    Posts:
    193
    i do mean that. If you want to do it manually, that works, but there is a feature tho that can do it automatically for you, up to you
     
  7. fakedev

    fakedev

    Joined:
    Jan 14, 2023
    Posts:
    7
    Using a Sprite Atlas appear the solve the issue, at least in the game.

    Thank you all!