Home Technical Talk

capturing hi-poly round corners with normal map?

wannabeartist
polycounter lvl 8
Offline / Send Message
wannabeartist polycounter lvl 8
Hi all!

How well can a normal map capture high poly's rounded corners?

A silhouette is what it is, but I think I've seen examples of some pretty convincing "round" corners in a very low-poly object - or am I mistaken?

I've been doing some tests with simple cubes and cylinders in Max and Unity3D, but so far the results are not very fantastic.

Thanks!

Replies

  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Hmm,

    It seems I had one channel flipped, tests look better now :D

    But I'm still a little confused about very noticeable seams in the end result - even though I tried keeping the UV seams to a minimum. Any tips?

    Thanks!
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    If possible, show some of your tests in case your method is wonky.
  • Mark Dygert
    Chances are you're not breaking the edges that run along UV seams before baking. But yea examples are pretty much a must if anyone is going to give any solid help.


    Also check out the polycount wiki, tons of great info in there about this stuff. Especially the section on smoothing:
    http://wiki.polycount.com/NormalMap?highlight=%28\bCategoryTexturing\b%29#Smoothing_Groups_.26_Hard_Edges
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Thanks for the replies,

    Sure thing, examples and specific questions coming up... I just can't use the actual piece so I'm doing a quick example prop. I'll be back with screenies in about half an hour.
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Ok, quick example wall is done!

    It came out pretty well actually, but fortunately still shows the problems I'm having with the actual piece ;)

    I made both high and low poly in Max and baked the map there also. Then I exported the low poly and the map to Unity3D to check it out.

    Notice the seam-artifacts on the extruded parts of the wall? That's the main problem - I have those all over the actual asset!

    I have been trying to find answers in the net, but I'm not quite sure I still have a clue about the right way to unwrap for normal mapping, so here are some questions:

    1) Where should I place seams and where to avoid them? Some sources tell that you should minimize seams, which makes sense, but ironically minimal seams seems to cause even more artifacts!

    2) Related to the first one, what about angles in the geometry? Some source said that 90 degree angles are "bad" - but does that mean seam or no seam? In the tests that I did it seems like 20 degrees is too much for planar mapping something, it creates artifacts everywhere.

    Thanks!

    Here's a screen from Unity and from Max (showing UV seams)
  • mparis
    Funny this is the exact same issue i was about to post on. I can provide further examples of this issue from Maya. Baking out via Maya/xnormal made no difference with those pesky 90 degree edges!

    Seams at the edges of low polys from the normal bake. Keep in mind there was no seam where the weird shading is occurring.
  • mparis
    Actually i just realized I hadn't sewn my UV edges together in this model, so technically there was a seam. I'll post up results once I rebake...
  • mparis
    Did you ever try using xNormals CUDA rendering function? My God, my normal map bake times went down very nicely! i don't know what that says about my CPU though...
  • mparis
    Alright well even without a seam present it still does this.

    It's like it's trying to show the curvature of the high poly object but forgets it still needs to render it uniformally between the two faces. Anyone know how to fix this?

    Again, in the image there is no seam between the top and side face pictured. Yet it still acts like their separate from each other...
  • mparis
    Vig wrote: »
    Chances are you're not breaking the edges that run along UV seams before baking. But yea examples are pretty much a must if anyone is going to give any solid help.


    Also check out the polycount wiki, tons of great info in there about this stuff. Especially the section on smoothing:
    http://wiki.polycount.com/NormalMap?highlight=%28\bCategoryTexturing\b%29#Smoothing_Groups_.26_Hard_Edges

    Are you saying you need to make every face separate before baking?
  • throttlekitty
    Only the UV faces should be separated; aim for a few pixels distance from each other.
  • mparis
    Only the UV faces should be separated; aim for a few pixels distance from each other.
    Oh alright thank you!
  • Mark Dygert
    Are you saying you need to make every face separate before baking?
    Short Answer:
    You need to break the edges on the low poly model where you have UV boarders.

    Long answer:
    On export/import the boarders will be broken changing the way the normals face which causes the seams.
    NormalMap?action=AttachFile&do=get&target=BenMathis_SmoothingGroups_Excerpt.gif
    On the left is unified which is what you have now (technically incorrect),
    On the right is what happens to UV boarders when you export.

    The problem is, it was baked while it was unified and it changes after you've baked, so you get a seam. If you bake with them broken the result is seamless, even though technically the low poly geometry is broken.

    So... your mesh, when you bake needs to match exactly the mesh as its imported. It depends on what method you're using to view the maps in the 3D app but chances are it will look incorrect until you get it in engine where it will be flawless.
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Wow,

    discussion really picked up ;)

    I still didn't get this completely straight, so I made yet another test piece. Here are screens for Unity3D, Max and the UVs

    Where should my seams go for optimal normal map? Here the seems are at 90 degree angles - and they came out looking pretty nice, but I left the arched part without seams - and look at the artifacts!

    So, how is this done correctly? Separate everything? What about smoothing groups? (Not used here).

    Thanks!
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    If unity is not synced to max's tangent basis then you might well run into issues. In fact for ideal results, whatever baker you are using should have the same tangent basis as your engine. If this is not the case, you are playing a game of damage limitation by squeezing a round-ish peg into a square-ish hole.

    For a test, try one of those models you have made in max viewport with the 3pointshader in 'quality mode'. If it is flawless looking you will know you are doing everything correctly and there is an interapplication mismatch somewhere. Then you enter the world of workarounds and fiddling to get the best result that you can.

    <edit>
    I think one of the big reasons that normal mapping is a bit of voodoo, especially for newcomers, is this culture of workarounds which exists. People start to think the workarounds are part of the workflow and it can get really muddled over time. 3pointstudios have made a fantastic product which allows a line to be drawn under the topic (at least with max) once and for all.
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Thanks,

    I'll try that. So it's not my UV seam placement?

    The tangent basis should not be totally of, because I already flipped the green channel in Max. Before that all the corners looked horrible in Unity. Now it's just those that don't have a UV seam.
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    Hmm, that 3Point shader looks awesome, but I guess it would need to have support in Unity's end to work?
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    I did some tests with seams.

    Turned out, that having seams everywhere, except the arched top part (3 topmost faces), yields best results.

    In the screen shot furthest from the camera is the one I previously posted, middle one has every face separate (maximum seams) and the closest to the camera is the one with seams except the top.

    So does this make sense? am I doing this right now?
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    Hmm, that 3Point shader looks awesome, but I guess it would need to have support in Unity's end to work?

    The important thing to unerstand is that if you check your stuff with the 3pointshader in max, and everything is tickety-boo, you can be sure your method is ok. In order to jerry rig your assets into your engine of choice it is a war of attrition to reduce the errors as much as possible bu breaking seams, adding a bit of geo here and there or other such workarounds. Also remember minor errors are usually not visible on most surfaces when diffuse is applied (unless they are really polished smooth hard surface stuff)

    Also make sure you have enough padding around your uv shells for your mips, or the seams will appear as the object recedes into space as the mips kick in.

    Good luck and good tests in your last post! It looks like you found your answer for unity. :D
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    cw wrote: »
    The important thing to unerstand is that if you check your stuff with the 3pointshader in max, and everything is tickety-boo, you can be sure your method is ok.

    Ah, so you mean using it like a "debug" tool? In Max's view port, then?


    Thanks, I'm not quite sure if I have find the answer just yet, though ;)

    The problem with adding more seams in the UVs is, of course, that painting the diffuse texture wont be that easy, but I guess it's worth the extra work.

    These tests were very simple and I haven't yet tried those changes in my actual work piece. Hopefully it will look better than the first attempts.

    I still have a ton of Max specific baking questions, like should the low-poly completely encompass the hi-poly (like I done so far) or the other way around?

    And what about the cage in Projection modifier - it seems like the lo-poly needs to cover the high poly perfectly or rays will miss, no matter how big I make the cage? And yet I've seen many tutorials where the hi poly penetrates the low poly randomly here and there without causing any issues with the bake.
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    Ah, so you mean using it like a "debug" tool? In Max's view port, then?


    Yeah I guess that's what I mean. :)

    Have a dig through the other threads about normal mapping and the rest of your questions should be answered in some depth.
  • mparis
    Vig wrote: »
    Short Answer:
    You need to break the edges on the low poly model where you have UV boarders.

    Long answer:
    On export/import the boarders will be broken changing the way the normals face which causes the seams.
    NormalMap?action=AttachFile&do=get&target=BenMathis_SmoothingGroups_Excerpt.gif
    On the left is unified which is what you have now (technically incorrect),
    On the right is what happens to UV boarders when you export.

    The problem is, it was baked while it was unified and it changes after you've baked, so you get a seam. If you bake with them broken the result is seamless, even though technically the low poly geometry is broken.

    So... your mesh, when you bake needs to match exactly the mesh as its imported. It depends on what method you're using to view the maps in the 3D app but chances are it will look incorrect until you get it in engine where it will be flawless.


    Many thanks Vig! I'll try these steps out tomorrow.

    And my apologies to wannabe, I hope my posts don't count as temporary hijacking. Hehe.
  • wannabeartist
    Offline / Send Message
    wannabeartist polycounter lvl 8
    @mparis,

    No problem. It's the same subject anyway ;)
Sign In or Register to comment.