Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Automatic texture padding

Discussion in 'iOS and tvOS' started by mudloop, Jan 25, 2011.

  1. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,105
    Hi all,

    I created a script that adds borders to tiles in a tileset texture. This is useful against edge bleeding.
    This will be part of the next UniTile release, but I decided to give it away for free as well.

    Just import the unitypackage, and you should get a new menu item (sometimes this doesn't show up right away, so you have to click somewhere on the menu first).

    Please note that this will create a new texture at a different size, so it may not be "power of two" anymore - so you should take that into account when designing the tileset.
    Your texture should have Read/Write enabled and be ARGB32, RGB24 or Alpha8 (but Unity will tell you if it's not correct)

    I've only tested this on one tileset, so if anyone encounters any problems, please let me know.

    Here's a tileset (by www.el-sato.com):


    (The tileset was doubled in photoshop because the tiles were very small)

    Here it is with a 2 pixel border around each tile:



    And here's a more extreme version with 16 pixels added on each side, just to show what it does:



    Edit: And here I've highlighted the stuff that has been added in black, so you can see that the original tiles are still there, they have just been extruded to each side:



    Enjoy!

    Sven
     

    Attached Files:

    Last edited: Jan 25, 2011
    florianalexandru05 likes this.
unityunity