Home Technical Talk

Normal Map Jagged Edges

Every time i make a normal map for my low poly usb model, one of the uv shells always has jagged edges. I don't think it's a hard/soft edge problem because no matter what i do (make the model all soft edges, make the model all hard edges, split uvs along hard edges, create uv seams along hard edges) it doesn't solve the problem.

Replies

  • EarthQuake
    Options
    Offline / Send Message
    pixel padding, its a good thing
  • TheWalkerGod
    Options
    Offline / Send Message
    EarthQuake wrote: »
    pixel padding, its a good thing

    Didn't work unfortunately.
  • EarthQuake
    Options
    Offline / Send Message
    What didn't work?

    What you're seeing is pixel padding. Its a good thing, There is no reason to try to "get rid" of it. It helps to avoid errors when the texture gets sized down (mipmapped) in game. If anything you should raise the pixel padding so it fills in the gaps.

    Apply the normal map to the actual mesh and you'll see its not a problem. You can't look at normal maps in 2d and see problems unless you really know what you're looking for.
  • TheWalkerGod
    Options
    Offline / Send Message
    EarthQuake wrote: »
    What didn't work?

    What you're seeing is pixel padding. Its a good thing, There is no reason to try to "get rid" of it. It helps to avoid errors when the texture gets sized down (mipmapped) in game. If anything you should raise the pixel padding so it fills in the gaps.

    Apply the normal map to the actual mesh and you'll see its not a problem. You can't look at normal maps in 2d and see problems unless you really know what you're looking for.

    I'm sorry, i thought you meant to lessen the gaps between the shells, which i did. I didn't realize that what i was seeing was actually pixel padding. Unfortunately i do get errors when's it's applied to the actual mesh.
  • Nam.Nguyen
    Options
    Offline / Send Message
    Nam.Nguyen polycounter lvl 9
    Those " jagged edges" is edge padding and like EQ said, it's a good thing.
    If you not sure exactly what it is, here is a good read : Polycount Wiki : Normal map > Edge padding

    the error you showing has nothing to do with edge padding. Baking normal map could be tricky and it'll took you a while to learn how to bake a proper normal map.

    again, polycount wiki has pretty much everything about normal map Polycount Wiki : Normal map


    and here is a good tutorial on how to bake a "perfect" normal map.

    [ame="http://www.youtube.com/watch?v=kGszEIT4Kww"]The Fundamentals of Perfect Baking - YouTube[/ame]
  • EarthQuake
    Options
    Offline / Send Message
    The issues you see on the edges there could be from:
    1. Lack of anti-alaising
    2. Skewed edges in your uvs. If the object is straight in 3d, make sure all of your edges are straight in the uvs as well. Having slightly angled edges in your uvs means you need much more texture resolution to clean represent those details. For instance, it only takes 1 row of pixels to represent a straight line, while it takes a minimum of 2 to represent and angled line.
    3. Poorly constructed highpoly mesh. Your highpoly should have nice thick bevels, otherwise the detail will not get picked up by the baker. Edges that are too sharp will cause aliasing issues.

    I would by looking at your images that the cause is probably all of the above.
  • sargentcrunch
    Options
    Offline / Send Message
    sargentcrunch polycounter lvl 10
  • TheWalkerGod
    Options
    Offline / Send Message
    EarthQuake wrote: »
    The issues you see on the edges there could be from:
    1. Lack of anti-alaising
    2. Skewed edges in your uvs. If the object is straight in 3d, make sure all of your edges are straight in the uvs as well. Having slightly angled edges in your uvs means you need much more texture resolution to clean represent those details. For instance, it only takes 1 row of pixels to represent a straight line, while it takes a minimum of 2 to represent and angled line.
    3. Poorly constructed highpoly mesh. Your highpoly should have nice thick bevels, otherwise the detail will not get picked up by the baker. Edges that are too sharp will cause aliasing issues.

    I would by looking at your images that the cause is probably all of the above.

    Thanks, that's some really useful info. I already have anti-aliasing applied at 4x so i don't think that's it. As for step 3, do you mean i should apply large bevels in Maya before subdividing in Mudbox, or that those bevels should appear when i subdivide in Mudbox. I've posted my Mudbox subdivision settings below in case that helps. I've also been using Xnormal to create the normal maps.
  • sargentcrunch
    Options
    Offline / Send Message
    sargentcrunch polycounter lvl 10
  • TheWalkerGod
    Options
    Offline / Send Message
    Your control loops are to tight, heres a picture that seems to be thrown around everywhere lol.

    racer.jpg

    Not only is it good for viewing at a distance, but when the loops are too tight, they don't bake down well, theres another picture demonstrating this, but I can't find it. But basically, avoid 90 degree angles on your high poly.

    Alright, thanks. I was actually able to fix a lot of the errors by straightening edges on my UV shells as Earthquake said. The reason the edges are so sharp on my high poly is because i turned of "smooth positions" in Mudbox since it changes the high poly way too much. I guess beveling and chamfering edges would be an alternative but isn't there debate on hard edges vs. beveling/chamfering since beveling an edge increase the vertex count and slows down rendering times?

    note: I'd just like to say thanks to everyone who's posted so far. This info's really great and helps a lot. I've learned so much about normal maps in the past couple days.
  • sargentcrunch
    Options
    Offline / Send Message
    sargentcrunch polycounter lvl 10
  • TheWalkerGod
    Options
    Offline / Send Message
    Well beveling your edges doesn't matter on a high poly mesh since its not used in game, you can make it 20 million polys, doesn't matter. But you should always give your high poly fat bevels on the edges that way it smooths nicer and bakes down smoother and gives you a much cleaner result.

    Thanks for taking the time to answer, i really appreciate it. However by only beveling the high poly mesh, it creates a weird sort of visual effect on the low poly edges, trying to make them look beveled i suppose. I duplicated the low-poly and beveled and subdivided in that order, before applying to the other low-poly mesh. Should i subdivide before beveling? Or maybe i didn't bevel enough. I understand the bevels should be big, but how big?

    Visual Error Located at edge (red added to help show error. Large black part next to red is shadow, not part of error.):

    WeirdVisualEffect_zps2432eb60.png


    How I Beveled:

    HowIBeveled_zps5f01aa2c.png
  • sargentcrunch
    Options
    Offline / Send Message
    sargentcrunch polycounter lvl 10
  • TheWalkerGod
    Options
    Offline / Send Message
    Wait, are you using the actual bevel tool? Bevel is just a general term, do you know about control loops? Heres a picture I just made.

    The red cube has really tight edges, which results in a very tight bevel on the edge, which will look awful when baked.

    The blue cube has nice fat edge bevels, which will bake much cleaner.


    Wireframe
    211a9207d4.png

    Turbosmoothed
    69cc8d9a7a.jpg

    Thanks, and thanks to everyone who gave helpful advice. The normal map is much cleaner now, plus I've learned a lot about baking normal maps.
  • Nightmare106
    Options
    Offline / Send Message
    Nightmare106 polycounter lvl 4
    This is an old thread, I know, but I keeps popping up when I'm trying to solve the same problem. I solved it accidentally and remembered how I solved it. Watch out for the scale of your object, take a look at the dimensions of your object, (make sure your scale and rotation is applied though) if it's in between 1-5, your object is not big enough for the baker to record the normals properly, you are falling out of the range of numbers (float) that the baker can handle. You can also figure this out if you try out different ray distances when baking without cage and the smaller values give better and better results until you reach the smallest distance but it is still jagged. Fastest way however would be, to measure some shortest distance between  a low poly and hipoly. For example, if it's 0.001 and your bake supports ray distances that can be as small up to 4 decimals, that means some of the other distances might be less than 0.001 and they will be rounded to either 0.001 or 0.  And yeah, keep those bevels thick if it fails and/or increase your texture resolution.
Sign In or Register to comment.