Home Technical Talk

Is padding needed for curvature/AO/cavity/etc?

polycounter lvl 3
Offline / Send Message
Thane- polycounter lvl 3
I was hoping someone could tell me if i need to bother with padding for anything other than the normal map or the final diffuse(mipmapping)?

Replies

  • rebb
    Offline / Send Message
    rebb polycounter lvl 12
    Anything that winds up being a texture lookup / mipmapped, imo.
  • EarthQuake
    Padding is basically never bad (except for the color mask in ddo which can throw things off). So... Why wouldn't you add it?
  • Thane-
    Offline / Send Message
    Thane- polycounter lvl 3
    EarthQuake wrote: »
    Padding is basically never bad (except for the color mask in ddo which can throw things off). So... Why wouldn't you add it?

    I find its less confusing to navigate or browse my UVs. At this stage in my learning anyway.

    Right now im doing cavity/curvature/AO map tests and as i pan around it feels like a big jumbled mess.


    I just had a thought. Once your all done rendering the Normal map, does the padding help it at all from there on? I assume from then on only the information within the UV islands is used, with the exception of LOD meshes?
  • EarthQuake
    If padding bothers you while working you can use the xnormal plugin to add it when you're done. Though honestly, you should just get over that, it's a pretty silly thing to worry about. If the issue is navigating your uvs, you should render out the actual uv layout and overlay it at the top of your layer stack, and toggle it off/on as needed.

    Padding needs to be there in the end result for mip-mapping, otherwise when your texture is seen at various distances and resizes from 2k to 1k, 512, 256, etc the edges will bleed into the background and cause seems. In game, mip-mapping is applied to all textures, so padding is always good to have.

    Not only that, you can never have *too much* padding, I usually set padding to like 32 pixels or something, really you want your padding to fill in the entire background space between uv islands.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 9
    Usually what I'll do is throw everything into a group in Photoshop and select the dead space in my UVs; then I'll shrink the selection a bit and convert that into a mask.

    If you aren't using PBR, you can set your AO's background color to black (a baking option in xNormal) and when you multiply that over your diffuse it hides everything around your UV shells.
  • EarthQuake
    Even if you're multiplying your AO for a non-PBR workflow, your AO should have padding too and shouldn't have a black background, unless you're only doing this while you work and plan to add padding later.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 9
    ^ Yeah definitely, I meant a black background in conjunction with padding. You get your padding and it still blacks out all the empty space so it keeps the painted areas of the doc the same general shape as the UV shells.
  • Thane-
    Offline / Send Message
    Thane- polycounter lvl 3
    Thanks guys
    EarthQuake wrote: »
    If padding bothers you while working you can use the xnormal plugin to add it when you're done. Though honestly, you should just get over that, it's a pretty silly thing to worry about. If the issue is navigating your uvs, you should render out the actual uv layout and overlay it at the top of your layer stack, and toggle it off/on as needed.

    Padding needs to be there in the end result for mip-mapping, otherwise when your texture is seen at various distances and resizes from 2k to 1k, 512, 256, etc the edges will bleed into the background and cause seems. In game, mip-mapping is applied to all textures, so padding is always good to have.

    Not only that, you can never have *too much* padding, I usually set padding to like 32 pixels or something, really you want your padding to fill in the entire background space between uv islands.

    There is no worry involved. Its me trying to wrap my head around the differences in the small changes i see in my 1x anti-aliasing renders of various maps and their settings in Xnormal, trying to interpret the changes. This is a personal thing im sure. Thats the short of it. Once i figure out a few decent settings for all these maps im sure ill rarely think about it again. But its still nice to know i don't have to worry about padding sometimes.
  • Zezeri
    Is there a rule of thumb how many pixels of padding are the best for a corresponding resolution?

    Is 8px for 4k enough? Or should it be 16px or even 32px?
  • EarthQuake
    Well first off, the are two types of padding to consider. The first is the post process padding where the edges are extended out. This value should be really high as there is literally no draw back to having a lot of padding, when one edge hits another it stops so "too much" is not a thing. Just set it to 32-96 or something so all background space is removed.

    Now, the second sort of padding is the padding you have inbetween individual UV islands to prevent one island bleeding into another as it mips. A good rule of thumb for that would look something like:

    8K: 32
    4K: 16
    2K: 8
    1K: 4
    512: 2
    256: 1
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    The required amount of padding depends on the filtering method too. Here is a writeup about it on the old wiki:
    http://oldwiki.polycount.com/EdgePadding?action=show&redirect=Edge+Padding
  • Thane-
    Offline / Send Message
    Thane- polycounter lvl 3
    rebb wrote: »
    Anything that winds up being a texture lookup / mipmapped, imo.


    Hmm, i got black edges in quite a few spots when trying to render out an color ID map in places where i tweaked the cage a little and other where i simply pushed the cage out...

    So..

    From that it seems that Earthquake is right, that you should add padding everywhere. I can't imagine the other maps would be unaffected if the ID map render is, but what do i know.

    When creating an id map, where you want the color to extend exactly to the UV borders, i guess everyone goes into their image editing program after creating their ID maps and fill in the missing color up to the uv borders? Or do you just add a couple pixels of padding and call it good?

    I guess i'd be easy enough just to use the paint bucket, sample each color and i think you only have to double click the same spot with a low enough tolerance setting and it should fill each layer up to the UV border lines.

    Or did i press an evil button i shouldn't have...
  • EarthQuake
    It depends what you're doing with your ID mask. If you're setting up your textures by hand/in photoshop rather than running them through dDo, you can simply add padding to the mask. The problem with dDo is that when it adds the edge padding, it will pull out color values that are different than your base colors, and it gets confused and thinks those should be unique materials. It has the same problem with anti-aliased edges afaik. I don't know if substance has these issues.
  • Thane-
    Offline / Send Message
    Thane- polycounter lvl 3
    Im not using Quixel stuff yet. (Still need to buy Zbrush too... ) I'm not sure what you mean by adding padding to the mask, but i will try to add padding to the render, then crop the UV islands with the selection of the blank space from the solid color UV render.


    Also, i should come clean for any other beginners and report that i guess my mis-alignment between my Max diffuse renders and my Xnormal normal map renders was due to me moving the HP mesh at some point while selecting my HP to apply materials or something. I suspected this might be it, reverted to the previous file and it renders accurately. Ugh...
  • EarthQuake
    When you bake the ID mask, make sure padding is enabled. Same as if you were baking normal or AO, I'm not sure where you're getting confused.
  • Thane-
    Offline / Send Message
    Thane- polycounter lvl 3
    Oh, okay i get it now. When you said "you can simply add padding to the mask", i thought you meant add padding to a photoshop mask for some reason. Thanks!

    Last question:

    What about anti-aliasing. Is it good to add some sort of AA so the selection is more rounded for screw head floaters for example. Is rendering in 4k or 8k shrinking to 4k better, worse or same would you guess?
  • EarthQuake
    Ah, well you can use the xnormal photoshop filter to add it to each map (diffuse/spec/gloss) when you're doing texturing as well. It doesn't really matter which point you add it.

    AA is generally good for ID masks, yeah. 2x AA vs 4x will be similar to 4k vs 8k sized down to 4k. Super smooth AA isn't really important for ID mask.
Sign In or Register to comment.