Home Technical Talk

Padding!

nefarius
null
Offline / Send Message
nefarius null
Hello all! Now i am preparing UV for weapon model.
I need to make edge padding and i've read that optimal amount for 4K texture is 32 pixels padding. And now  i want to ask one noob question: does edge paddong represent amount of pixels between islands of UV or around every island?
Thanks in advance! :)

Replies

  • Zalek4
    Offline / Send Message
    Zalek4 polycounter lvl 5
    Padding represents the amount of pixels bled out from each UV island, not the amount of pixels between each of them.
  • nefarius
    Offline / Send Message
    nefarius null
    Zalek4 said:
    Padding represents the amount of pixels bled out from each UV island, not the amount of pixels between each of them.
    thanks for help! =)
  • Mark Dygert
    This probably helps too. http://wiki.polycount.com/wiki/Edge_padding

    It becomes important when your textures start mip-mapping down in resolution, because of performance or for Levels of Detail.

    As the pixels get bigger and chunkier there is a greater chance that the non-rendering area will bleed into your UV space and start to create ugly artifacts. If a low mip-map is only ever seen on a tiny LOD way off in the distance it might not be an issue. If the LOD is up close you'll probably notice a seam.
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    well first of all, there is never too much padding

    but 

    usually our clients speak of pixels between islands, not around islands

    i mean seriously if you had 32 px padding around each island, that would be 64 pc between islands, no matter how hard you mip, this sounds very much like overkill
  • Mark Dygert
    Yeah, Neox brings up a good point.

    Usually you can crank the padding up to a high number like 32px just because no one cares what is in the dead space so you might as well fill it with something that could help.

    That usually doesn't mean your UV shells need to be 64px apart from each other. Most banking tools usually stop at the mid point between two shells if they are closer than 64px.

    You do need some day light between your shells so they don't bleed into each other. Or you can group like colored/material shells next to each so if they do bleed it's something similar.

    But it really depends on how they are planning to use the models. They might be making a high end PC game and then plan to make a mobile version out of the same assets? That is about the only scenario that I can think of that would have players looking at a severely mipped version of the texture.
  • thomasp
    Offline / Send Message
    thomasp hero character
    They might be making a high end PC game and then plan to make a mobile version out of the same assets? That is about the only scenario that I can think of that would have players looking at a severely mipped version of the texture.

    in that scenario you would most likely not just reuse a texture from - say - a highend PC title but rather go back to the workfile and tweak it for the kind of resolution you're after and probably also adjust all sorts of values to a different engine, simplified shader, etc.

  • FourtyNights
    Offline / Send Message
    FourtyNights polycounter
    At least Marmoset Toolbag 3 can bake with infinite padding, and that's the best way, IMO. No one should ever worry about how many pixels to dilate. Infinite is the answer.
  • rollin
    Offline / Send Message
    rollin polycounter
    Guess best would be to consequently use "uv edge color dilation" instead of "padding".
    Everything else is just the distance between uv islands and a minimum value for it which you want / need / have to respect
    Only if (for whatever reason) you want a fixed dilation width, which would also be used as guide for your min distance between uv islands, it would be like "padding" == "dilation width" == "half min-uv-distance". 
  • Eric Chadwick
    Short answer... Test it out in the game engine, at the viewing angles you'll be using in the game.

    If you want to see why, put black inside your UV islands, and hot pink in the gutters. Then view the model in the game, at gameplay distances.

    Repeat with different padding amounts. Then you can determine the least padding needed.
  • EarthQuake
    There are two things here, how much space between islands, and the distance to dilate the edges out in the baker.

    For the first, you want to make sure that there is still space between islands as the texture mips down or if the user has lower quality texture options enabled. So let's say our base unit is a 4k texture, and we use 32 pixels:
    4k - 32 - 16
    2k - 16 - 8
    1k - 8 - 4
    512 - 4 - 2
    256 - 2 - 1
    128 - 1 - 0.5

    32px is good if you're expecting your 4k texture to be mipped down to 128 and still hold up, but perhaps extreme for general use. Something like 16 pixels between islands at 4k is probably fine for many cases. In any case 16-32 is pretty safe for a 4k texture.

    This tends to depend somewhat on the asset as well, let's say you've got a UV island that is white right next to a UV island that is black, you may want more space between these two than two islands that are the same shade of gray next to each other. How the texture will be viewed is important too, if it's a roof tile on an atlased environment sheet, it's probably going to be viewed at extremely acute angles and will be mipped/filtered to hell, so more padding is generally good in that case. This is pretty easy to test in game and may vary by the engine you're using, so you should try it out yourself.

    Now, when it comes to how much pixel padding to add in your baking app, as has been mentioned there is no "too much", so just use plenty. In Toolbag we set it up so the value is automatically calculated by the resolution that you're using - the normal setting adds "plenty" and the extreme setting adds a lot, basically filling in the empty UV space.
Sign In or Register to comment.