Home Technical Talk

Padding issue

interpolator
Offline / Send Message
huffer interpolator
UPDATED images with extreme case scenarios. While it's rare these will be visible, there are projects where texel density is too low and they become an issue:








I have the following issue - I have to bake some very low res maps, and I noticed pronounced hard edges with bakes in 3dsmax and xNormal, but near perfect with Maya. All hard edges have UV splits, always baked with a cage. After some testing this is what i found:





EDIT, Clarifications:

- baking with 0 padding in Maya, Max or xNormal gets the same result (visible hard edge, artifacts, standard issues when you don't use padding). Every solution to add padding after bake (dilation, ps actions) acts by extending the border pixels, but I still get the visible hard edge.

- baking with padding (no matter the value) in Max and xNormal improves the hard edge by a tiny bit, but the padding works by stretching the border pixels outwards, so they are the same color - similar to dilation.

- baking with Maya with padding (starting from 1 pixel) adds another row of pixels inside the UV border, and then everything that's extended it's a different color (as in the picture above in the different shades of purple). It's totally different, and this and only this gives the super smooth perfect edges (even at 128x128 res)

The hard edge shows up with the bake from xnormal/Max, both bakes with padding 4, 64x64 resolution.

What's happening here? How can I fix this inside 3dsmax?


Replies

  • SuperFranky
    Offline / Send Message
    SuperFranky polycounter lvl 10
    Try using more padding? For low res you should have much more than 5px
  • huffer
    Offline / Send Message
    huffer interpolator
    Yeah, but no matter how much I increase padding in max, there's still the same colored pixels extended from the border. Maya adds another line of pixels inside the UV shell, of a different color. It's like a gradient on top of the border that gives me the perfect smooth edge - even with 1px padding in Maya it looks good. :poly142:
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    Basically you asking about two different algorithms, Im not sure where either originated from, I would imagine they are not the same as the two products have two separate development teams.

    Maya looks like its expanding the pixels based on the normal and max looks like it just going straight along the x axis.

    If you want to bake in max, xnormal has a dilation function in photoshop that works well.

    My experience has always been that maya bakes better normals than max.
  • huffer
    Offline / Send Message
    huffer interpolator
    Yup, I agree that the results are better from Maya, but it bugs me since I need to use 3dsmax tangent basis (I baked once in Maya for the borders and once in Max for the rest).

    If I bake both in Maya and Max with 0 padding, the results are the same, there's that hard edge that shows up (top right screenshot). Only when starting to add padding in Maya something changes and I get the good results, so increasing the padding after bake might not help - I need to have more saturation/gradient in the edges (like in the Maya bake with padding), at least that's what I think, but I don't know how to recreate the results in max or xnormal.
  • Butthair
    Offline / Send Message
    Butthair polycounter lvl 11
    Pretty strange as I've never seen the type of padding from max and xnormal when I do bakes.

    Maybe I just never noticed them before.

    In any case, I tend to handle padding in photoshop when all adjustments are done. I like to blend the UV islands (with 0 padding) into the padding itself so there aren't harsh transitions. I did this on some sci fi chess mechs and I liked the results much more than from the bake.
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    where do you preview your maps?
  • huffer
    Offline / Send Message
    huffer interpolator
    Both in 3dsmax, Maya, and Marmoset I get the same results - the bake made in Maya looks great and gives me the smooth edge. The screenshots are from 3dsmax. Now I realise that all bakes I've done in the past had this hard edge visible when zoomed in close, and I assumed that was okay, but damn, baking in Maya gives me perfect edges even at super low resolution.
  • huffer
    Offline / Send Message
    huffer interpolator
    Bump. Anyone got any ideas? It seems that the padding in Maya with a cage looks exactly like the padding in xnormal or max but without a cage - it's the same range of colors weirdly.
  • huffer
    Offline / Send Message
    huffer interpolator
    Bump, 8 months later! Anyone got any ideas? I'd really like to keep using 3dsmax and xnormal for my bakes :(
  • marenin
    Offline / Send Message
    marenin polycounter lvl 8
    I'm totaly with you.
    I think maya do better job here becouse it "'see" information beyond uv shell seam and interpolated this to pixels on the edge of uv. "Fill texture seam" function just make that effect more visible.

    Max, Xnormal, Modo, Blender from my test just ignore information beyond uv shells. Completely stop raycasting right on pixels on uv edge. But in most cases right on uv seams of lowpoly we have dramaticaly angle changes of hipoly surface, that need to be baked to be interpolated info in pixels on uv edge.

    Crapy workarounds only, like place exaggerated flat!(not round) chamfers on hipoly along uv seams of lowpoly... That makes information before and after uv shell pretty match the same and for baker no need to see information beyond uv shells to make almost correct result on seams.. (

    or... bake in maya.. pff.. but would be nice to see a another solution

    hope i was understandable
  • huffer
    Offline / Send Message
    huffer interpolator
    @marenin Whoops, missed this reply. Totally understand, I'm baking some really low res normal maps now and the difference is huge. Getting so smooth edges in Maya. Here's what the edges and padding look like if anyone wants to see the difference:



    I haven't found any alternative yet (and it's been 3 years!!), it's so very cumbersome to continue to bake them in Maya.
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    oh this might be why the normalmapmblur in maya works so well vs. the one in marmoset

    yeah maya is slow, but damn it bakes the best normalmaps
  • marenin
    Offline / Send Message
    marenin polycounter lvl 8
    Maya is slow and have wrong tangent space and worst baking pipeline ever, and besides it's cannot bake in 16 bit format... it's useless for our production.

    We work in our studio on our proprietary(for now) baker with some nice features like "skewing control", "raycast from lowpolys intersections" and of course baking pixels beyond uv shells instead of just padding.
    Still in early pre alpha production prototype stage, but our artists in company(not freelancers) already baking only in it all the time now and love it. Hope we can deliver it for everyone, if anyone will need it.

    Not the best example, but thats what i have for now to show something:

  • huffer
    Offline / Send Message
    huffer interpolator
    @marenin Holy smokes amazing! Where do I sign up? I'd pay hard money for that kind of quality! Even though I use Toolbag regularly if there's a project where the texel density required is too low and those seams become visible I have to struggle back and forth between Maya/Toolbag/Photoshop and fix all the bakes :(

    And if raycast from intersections works as I think it does...wow. 
  • marenin
    Offline / Send Message
    marenin polycounter lvl 8
    @huffer Wow. Did not count on such positive reaction, thank you.
    Unfortunately there is no place to sign up for now, sry.
    Its too early, baker in pre alpha stage, have no proper ui, we did not think about where or how to deliver it yet.
  • huffer
    Offline / Send Message
    huffer interpolator
    @marenin No worries, let me know when/if possible.

    I updated the first post with the original images to show the difference in extreme cases.

  • Noors
    Offline / Send Message
    Noors greentooth
    Is this related to this algo ?
    Very interesting compare to a "dumb" pixel extension.
    Bakers should definitly look into it @EarthQuake
Sign In or Register to comment.