Author Topic: BUG: Inconsistent UV coordinates when using UV Padding  (Read 339 times)

pkorzeniewski

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
BUG: Inconsistent UV coordinates when using UV Padding
« on: May 18, 2018, 11:45:30 AM »
In the image below, tiles on the left were placed with UV Padding set to 1x1, on the right 0x0. The larger tile is one tile, not 3 small tiles. The problem is when using UV Padding, the UV coordinates are inconsistent and depend on the size of tile.


Gittens

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: BUG: Inconsistent UV coordinates when using UV Padding
« Reply #1 on: October 16, 2018, 01:41:39 PM »
How do you get rid of this inconsistency? It's kind of a big deal.

Alex

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
    • View Profile
Re: BUG: Inconsistent UV coordinates when using UV Padding
« Reply #2 on: October 16, 2018, 02:23:31 PM »
I will look into this issue today and see if I can fix it.

Alex

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
    • View Profile
Re: BUG: Inconsistent UV coordinates when using UV Padding
« Reply #3 on: October 16, 2018, 03:48:43 PM »
Okay, I checked it out and now I understand what you're dealing with.
Since it only pads the edges, a tile that consists of more than one tile will have more pixels fit in.
So if you have 3 tile high, that would be like 16x3=48.. 48-2 (1 padding on either side).. so 46 pixels fit in the 3 tile high tile.. so that's like 15.3333 .. and the 1 tile high has 16-2, so 14 pixels fit.. So when they are positioned next to each other, their pixels don't align perfectly because one fits more pixels than the other..
I'm not really sure if this can be solved since a tile can't use more than 1 uv mapping- and the padding is what adjusts the uv mapping. If you have it set to 1x1, it adjusts the uv mapping of the tile so that the coordinates are inset 1 pixel on each side.

So, basically it's just a limitation of using padding on different sized tiles. If anyone has ideas on a solution, let me know.

pkorzeniewski

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: BUG: Inconsistent UV coordinates when using UV Padding
« Reply #4 on: October 16, 2018, 04:49:57 PM »
Ok now I undestand, using tiles with padding is generally a bit tricky, it's easier to use tilesets without padding and just use correct texture rendering method to avoid edge bleeding.

Alex

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
    • View Profile
Re: BUG: Inconsistent UV coordinates when using UV Padding
« Reply #5 on: October 16, 2018, 07:20:17 PM »
Yeah- that is what I would do.