Search Unity

Automatic texture padding

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

  1. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    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.