Home Technical Talk

Having trouble with this bake in Xnormal.

polycounter lvl 12
Offline / Send Message
Hayden Zammit polycounter lvl 12
Hey guys. Was hoping someone could help me out here.

Been using Xnormal for the first time. I've imported an obj for my low poly and an obj for my high poly.

I grabbed the low poly's verts, scaled them out along their normal and used that for a cage in xnormal. Here's the bake I get using the cage:

GRr0YER.jpg

and here is without the cage:

KUjq4Y1.jpg


Everything seems to bake alright except for the holes along the side when I use the cage. When I don't use the cage, they bake perfect, but then the grip at the bottom doesn't bake properly, and some of the edges throughout the model aren't as nice.

There's also this little part that bakes like this with a cage:

PTrTbbB.png

but without a cage it looks better:

wAKDQ2S.png

Would it be best to just use NDO to add the holes on the side and the indent in those last pics?

Any help on what I'm doing wrong would be great.

Replies

  • a3D
    Options
    Offline / Send Message
    a3D
    The cage produces distortion because:
    http://www.polycount.com/forum/showthread.php?t=81154
    see the "skewed detail" for a better explanation

    And here is a solution
    [ame]https://www.youtube.com/watch?v=NRNL_21Ee_w[/ame]
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Thanks for that link. I followed it as best I could. It just gave me warped results. I looked at that write up too and was able to fix the small indent easily by adding two extra loops. Haven't tried it on the holes yet.

    I'm not sure I like that method though. Seems like it could be pretty wasteful. nDo seems like a better approach.
  • a.marlowe696
    Options
    Offline / Send Message
    a.marlowe696 polycounter lvl 5
    Your problem is the holes are a perfect 90 degree angle. You need to scale the inside of the whole to make it "appear" deeper. If you bake a perfect hard edge then you get shallow looking results like you did.
    On a side note is this all one piece? If not are you exploding the mesh for baking? Are you assigning smoothing groups correctly, if at all?
    There are so many factors in getting a perfect bake.

    Good xNormal info:

    http://docs.cryengine.com/display/SDKDOC2/Ambient+Occlusion+and+Normal+map+bake+using+Xnormal#AmbientOcclusionandNormalmapbakeusingXnormal-HowtousexNormalfornormalmapbakesandgettingthebestresults

    Normal Map info and rules: (dont skip this thinking you know it all)
    [ame]https://www.youtube.com/watch?v=ciXTyOOnBZQ[/ame]


    P.S.And you dont need this ^^ software, they just explain stuff a lot of people bypass/ignor/simply just dont know.


    Let me know if something isn't clear! Hope it helps!
  • EarthQuake
    Options
    Offline / Send Message
    Thanks for that link. I followed it as best I could. It just gave me warped results. I looked at that write up too and was able to fix the small indent easily by adding two extra loops. Haven't tried it on the holes yet.

    I'm not sure I like that method though. Seems like it could be pretty wasteful. nDo seems like a better approach.

    If you don't want to add extra geometry to the final mesh, you can create a copy, add the loops/cuts, bake an object space map, and then convert object space to tangent space with handplane.

    Though honestly, correcting bake errors shouldn't add a significant enough amount of geometry to make a difference when it comes to performance. Often, the extra geometry can be used to give the model a better silhouette, and other times, you just need to cut in a couple verts rather than a full loop.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    Can't you also tweak the normals of the lowpoly to change projection errors like that?
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Your problem is the holes are a perfect 90 degree angle. You need to scale the inside of the whole to make it "appear" deeper. If you bake a perfect hard edge then you get shallow looking results like you did.
    On a side note is this all one piece? If not are you exploding the mesh for baking? Are you assigning smoothing groups correctly, if at all?
    There are so many factors in getting a perfect bake.
    Yeah, it's all one piece, so no exploding. For these test bakes atm I'm just using a script to assign hard edges to all my UV edges.
    If you don't want to add extra geometry to the final mesh, you can create a copy, add the loops/cuts, bake an object space map, and then convert object space to tangent space with handplane.

    Though honestly, correcting bake errors shouldn't add a significant enough amount of geometry to make a difference when it comes to performance. Often, the extra geometry can be used to give the model a better silhouette, and other times, you just need to cut in a couple verts rather than a full loop.
    I actually don't mind a bit of extra geo to fix these issues. As you said, it shouldn't be a significant amount. I read through that write-up you did on Skewing when baking. I saw you usually just add a vert for things like this:

    OI8Dypo.png

    1Fgwttk.png

    You can see there's still a bit of skewing. Is it something you can get perfect? Or do you just try to get it close enough?

    Here's the result baking without the cage:

    Cb4CSHF.png

    thanks.
  • EarthQuake
    Options
    Offline / Send Message
    You can get it perfect with even more geometry, you could cut three or four verts outlining the shape as well, but it helps to keep things in perspective. How large is this element? Will you be able to zoom in on it in game? If not, zoom the hell out and move on with your life. =P
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    it's a detail piece on the back of an ammo clip thingy. Doubt it'd ever be seen, so yeah, moving on lol.

    pqxv9aR.png
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    Do you mind posting that part of the model? I want to try a few options.
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Do you mind posting that part of the model? I want to try a few options.
    Sure.

    Got the high poly and low poly in it. Forgot to put the cage in, but i was just exporting a version of the low where I'd grabbed all the verts and moved them out a bit along their normal.

    http://www.mediafire.com/download/rr3d8mc93mimia3/AmmoClip.rar

    Lemme know ya results.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    Well my 3 ideas didn't work.

    1. setting the faces you didn't want distorted to have custom normals. Results had projection errors.

    2. Same as 1. but averaged the cage. Results had projection errors.

    3. Tried to split uv groups and back and then merge. It completely fixed the projection, but caused errors on the seams like number 3 in the second example.

    cVCmfP3.png

    O2OPVuX.png
  • EarthQuake
    Options
    Offline / Send Message
    Ah yeah that detail is soooo super small. While we're talking about viewing distance, your edges are really hard for something that small, you should have nice soft edges, otherwise you'll need a very high res texture to hold that detail.
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Well my 3 ideas didn't work.

    1. setting the faces you didn't want distorted to have custom normals. Results had projection errors.

    2. Same as 1. but averaged the cage. Results had projection errors.

    3. Tried to split uv groups and back and then merge. It completely fixed the projection, but caused errors on the seams like number 3 in the second example.

    Ah, thanks for trying anyway. For the errors that were on the side I just kept those extra supporting verts like Earthquake suggested earlier and added a single vert in the middle for the little detail on the back.
    Ah yeah that detail is soooo super small. While we're talking about viewing distance, your edges are really hard for something that small, you should have nice soft edges, otherwise you'll need a very high res texture to hold that detail.

    This gun is probably going to be first person, but yeah, I'll go back and soften all the edges on the high poly before I bake. I can never seem to figure out just how soft they should be.
  • EarthQuake
    Options
    Offline / Send Message
    The way I figure it out is to regularly zoom out and view the asset from the intended distance. If it's a FPV gun, make a camera with a typical FPV placement. If you notice the edges looking tiny or aliasing, you know you've made them too hard. The issue typically stems from zooming in really far to do detailing work, so you just need to make sure to frequently check the asset how it will be viewed in game to make sure the scale of detail works.
  • Hayden Zammit
    Options
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    The way I figure it out is to regularly zoom out and view the asset from the intended distance. If it's a FPV gun, make a camera with a typical FPV placement. If you notice the edges looking tiny or aliasing, you know you've made them too hard. The issue typically stems from zooming in really far to do detailing work, so you just need to make sure to frequently check the asset how it will be viewed in game to make sure the scale of detail works.

    Ah ok. Thanks for the tips. I'll keep this in mind when I'm finalizing the high poly for this.
Sign In or Register to comment.