Home Technical Talk

xNormal Workflow question

I wanted to make normal maps to bake my High Poly to Low Poly. I have a model ready to go. Do I need to unwrap the model? If I do then do I need to collapse it back into an Editable Poly? I have pretty much tried both methods but the normal isn't coming out the way I expect, or at all really. So in general I am just lost. I have been watching tutorials and it looks like xNormal can make great normal maps but not when I do it.

Here is what's going on.
This is my High Poly:
I0FuKg9.png

Low Poly:
1EaTNHD.png

and the Normal Map xNormal made:
wvJzr7L.png

The models have smoothing groups cleared and set to one (1). They are aligned over each other. There are no n-gons. I exported them as .sbm with cage turned off on the low poly. The only thing is the model itself is not set a 0,0,0 in the coordinate space because there are other models in the overall scene. In xNormal the baking options are set: Size 1024x1024, Edge Padding 2, Bucket Size 512, Default Render, 4x Antialising, Normal Map checked with Y- set on Swizzle coordinates. Ray distance was ran for 5 seconds. What am I missing or what am I doing wrong?



Also any suggestions on how I could improve any of these models as this is my first time doing a high poly to low poly model.

Replies

  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    What does your UVs look like ?
    For me it seems there is some mismatch with the UVs regarding your normal map result.
  • unscodst
    Options
    Offline / Send Message
    This is why I love this forum, I already have a reply!

    Froyok. That's the thing, I never unwrapped them. I was trying to find an answer online but every video I seemed to watch just show people exporting the Hi and Low poly model so thats what I did.

    So I should unwrap them? If so do I collapse the model after I unwrap it or do I just keep the unwrap UVW in the modifier stack? Also when I unwrap them do the need to look exact? Like if I exported my Hi and Low poly unwrap and brought them into photoshop on their own layer should they line up exactly on top of each other?
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Each UV island requires its own smoothing group. If you have overlapping UVs, offset (by 1 unit) all overlapped islands except one outside the 0-1 area. The HP and LP both need to be occupying the same virtual space when exported (being at origin doesn't matter as long as they are in the same spot). Edge Padding and Bucket Size will not affect results; Edge Padding has more to do with mipmapping.

    It's important to load a cage before baking, especially for models with enclosed areas like your grating holes. The ray distance calculator can only do so well and doesn't work so well with some surface topology, but making a cage lets you determine exactly how far out the rays are cast across your entire model.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    Unwrap the low poly. Don't worry about unwrapping the high poly. Once you make changes to the UVs using the uv editor you can freely convert to editable poly and make changes, then put another uvw unwrap modifier and continue editing the uvs. You don't lose your work when you collapse.
  • unscodst
    Options
    Offline / Send Message
    Bartalon, sorry but your explanation confuses me. Assume I don't know anything when it comes to this.

    What I think you are saying is unwrap the sides (Left, Right, Front, Back ,Top, Bottom) and spread them out on the UVW Map but make sure they aren't touch? Does that mean the Top and Bottom can not overlap even though they are the same?

    I also turned off cage because one tutorial I was doing said that xNormal would cage for me.


    Quack!, Thanks as well. I assume the workflow you are explaining is starting from Low Poly and going to High? Also when you say to add another UVW Modifier doesn't that negate what I unwrapped before. So I would have to completely unwrap it again to add the new polys.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    Just do a quick test. Unwrap part of your object. Right click convert to e-poly. Extrude a face. Unwrap again, and observe the changes.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    1) Unwrap your low poly. Any surfaces that end adjacent to a harsh edge should be their own UV island. In this specific case, the top, four sides, and each inside portion of each hole should be separate, which means they shouldn't be touching or overlapping.

    2) If you have any islands that are stacked on top of others (from mirrored or duplicate objects), move them 1.0 units in any direction in UV space. This is to prevent xNormal from baking multiple sets of information in the same texture space.

    3) Create a cage with the Push modifier. Keep the cage as close to the surface of the low poly as you can but make sure it encapsulates the low poly. Triangulate and export both the low poly and the cage.

    4) Load your HP and LP as usual into xNormal. On your LP, right click and choose Browse External Cage File and assign your cage. You'll receive a prompt to make sure the cage is exactly the same as the LP. Just click OK and then Generate. Your results should improve.
  • unscodst
    Options
    Offline / Send Message
    Quack!, I am working on making a test, Ill let you know how it goes.

    Bartalon, thanks for being descriptive. I understand that more. So basically when I unwrap nothing should be touching at all. Ill work on that as well.
  • EarthQuake
    Options
    Offline / Send Message
    Not directly related to your woes here but, how will this be used?

    It looks like floor grating, if this is something you intend to repeat many times down a corridor or something you'll be better off using a flat plane and alpha mapped transparency. Otherwise you're going to end up with a crazy high polycount if you need to instance this piece a lot.
  • unscodst
    Options
    Offline / Send Message
    Hey EarthQuake, yeah this is a floor grate. It started out as a prop piece for a scene I am going to make but I plan on importing it into UDK or Unity. It has potential to be a game asset down the road if I can get it done right this time.

    I need to figure out how to do alpha mapping. My main concern is that if I alpha map it, will the holes look solid around the interior or will they be transparent as well? Or basically how would I go about making it work?

    As you can tell I am very new to this. I know how to model for the most part but this is my first time trying to actually make a whole scene for a portfolio piece. I am hoping i'll learn a lot by doing this so that I can continue making pieces quicker and flesh out my, so far non-existent besides school work, portfolio.

    So thank you all for your help so far.
  • unscodst
    Options
    Offline / Send Message
    Here is my detailed report.

    I made a box, unwrapped it, collapsed it, then made a copy. I edited the copy to test out angles and general curiosity of something slightly more detailed. I then unwrapped the High Poly. The UVW's were all messed up except for the basics from the Low Poly. After a lot of breaking and stitching I came up with the second UVW Unwrap below.

    Low on the Left, High on the right:
    dzU2r80.png

    Low UVW:
    L13vViz.png

    High UVW:
    LeLH95l.png


    I then made a cage by copying the Low Poly box and adding a push modifier on it. The white is the Low and the green is the Cage. I then converted the Low Poly and the Cage into an Editable Mesh so that it would be triangulated. I did not convert the High Poly to Editable Mesh, so it is still an Editable Poly.

    7jHveQq.png
    fowNXpK.png

    I exported each object; High, Low, and Cage as a .sbm. I then loaded up xNormal. Put the High in the High, Low in the Low and added the Cage to the Low. I did not run Ray Trace as I assumed having a Cage would negate running it. Here is the normal map that was created.
    KaOC0tC.png

    So everything seemed to work except that I have weird lines through two sides of the Normal. I also applied the normal map onto the Low Poly in 3DS Max and no features show up.

    I made a standard material, added a Normal Map into the Bump Maps, then in the Normal Map I added the Normal. I set the view port to realistic and then placed an Omni Light to move around and the surface is still flat.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    Nice to see you testing with a simple object, that is the best way to learn. Like I stated before though, the high poly doesn't have to have any unwrap at all, so you don't have to worry about that step at all.

    I would NOT use the convert to editable mesh technique to triangulate your model. Bad things can happen there. Instead use the "Turn to poly" modifier and "Limit Polygon Size" to 3. Non destructive.
  • ZacD
    Options
    Online / Send Message
    ZacD ngon master
    I don't use Max daily so I cannot help you with those settings, but just a heads up, you don't need to upwrap your highpoly model, it has no effect on the bake.
  • unscodst
    Options
    Offline / Send Message
    So I went back and removed the UVW Modifier from the High Poly. I then took the High, Low, and Cage and added a Turn To Poly with a limit of 3. I Collapsed them, was I supposed to / do I need to?

    Here is the new Cage and Low:

    xBiNxgj.png

    And the new Normal:

    YsvjO4f.png


    I still don't get why I have weird lines going through the Normal. As far as I can see there aren't any lines doing that in the model. Over all though I am glad I am getting closer to sorting this out. The real challenge will be doing it to my grate model.

    I also just found out that the Normal does show up when I render, it just doesn't show in the view port.
  • unscodst
    Options
    Offline / Send Message
    Last night I did a lot of messing around. So a few things that I think happened overall. For one I got rid of the weird line, I think my problem was that I mistook the explanation of the Cage and made it too small so it never encompassed the High Poly. The second was the explanation of smoothing groups.

    At first I gave every side of everything their own smoothing group, but I did make sure they matched up. Example: Top was smoothing group 5 while Bottom was smoothing group 6 on all of them, Low, High and Cage. Obviously this made everything too smooth.

    I eventually realized that I did not want my High Poly smooth so I cleared those groups. I then cleared the Low after and told 3DS Max to Auto Group it, at this point I believe I did the same for the cage, I did A LOT of tests and they all blend together at this points.


    Either way I came out with the lower right Normal.

    RzkOQz1.png


    I still see some problems, especially when looking over at the other Normals and what I feel should look right. Those are outlined here:

    1he1XwG.png

    Anyways I feel like I am getting a better grasp on making normal maps. I still want to solve these problems, or get an answer on whether I am doing this right, before I continue onto my other pieces.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    Smoothing groups:

    1. If you are using an unsynced workflow then harsh angles > 70° to 80°(varies depending on topology) need to be their own smoothing group. If synced, you may still need to, but to a much less degree.

    2. Where ever you have a UV island, you need to have a smoothing group break.

    There are some exceptions to this, but these are the basics.

    The reason that some of your normals are skewed, is because they are being pulled toward the low poly verts/normals during the bake. If you want to remove the skewing, cut in a vertex or add a loop to that uv island. If the detail is small enough, it probably isn't necessary, but on some large details it is important to spend a few triangles to fix normal map skewing.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    I'm surprised this hasn't been mentioned yet. Read this post. It's rather lengthy but it goes over, in depth, the causes and solutions to many of the issues you are having, and will likely answer many of your questions along the way. Be sure to read all of it, don't just skim!
    unscodst wrote:
    Shouldn't the bottom look the same as this one?
    The portions of your normals that have uneven edges are due to your LP surface topology not matching your HP model closely enough, and possibly also the orientation of your vertex normals. Read this post regarding those types of problems, though the previous post I linked is probably more pertinent for foundational knowledge on normal mapping.
  • Nosslak
    Options
    Offline / Send Message
    Nosslak polycounter lvl 12
    Quack! wrote: »
    2. Where ever you have a UV island, you need to have a smoothing group break.
    I think you messed up the order here as it's supposed to be:
    Where ever you have a smoothing split, you need a UV split as well.

    If you unwrap a cylinder or whatever you don't need a smoothing split everywhere you split the UVs. If you do that the normalmap will have to compensate for that by creating gradients which are widely hated as they lead to additional problems.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Nosslak wrote:
    I think you messed up the order here as it's supposed to be:
    Where ever you have a smoothing split, you need a UV split as well.

    They are sort of one in the same, it just depends on how you unwrap. If you go through and unwrap, the islands have their own smoothing groups. If you tweak your smoothing groups at harsh edges, you need to go back to your UVs and make them reflect the changes.
  • Nosslak
    Options
    Offline / Send Message
    Nosslak polycounter lvl 12
    Bartalon wrote: »
    They are sort of one in the same, it just depends on how you unwrap. If you go through and unwrap, the islands have their own smoothing groups. If you tweak your smoothing groups at harsh edges, you need to go back to your UVs and make them reflect the changes.
    When making hard surfaces they are mostly the same but there are instances where all UV splits shouldn't be hard like on these:
    UVsplits.png
    Or on organic models.

    If these UV-splits were set to hard (like they are in the image) the normalmap would need to compensate for this to restore them to how they look on the highpoly more than if you had not placed the smoothing splits there. Splitting either UVs or smoothing groups is free if you've already split one or the other in that place. The normalmap will however compensate with gradients which can look like crap if the tangents aren't synced, there isn't enough bitdepth and it won't compress or mip as well as without them. These examples would probably work fine but you should keep this stuff in mind anyways as it will only benefit the model as there are no downsides to it.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Nosslak wrote:
    When making hard surfaces they are mostly the same but there are instances where all UV splits shouldn't be hard

    Yes, I agree. It's more of a rule of thumb than a concrete fact. I suppose I was trying not to be confusing to someone trying to learn the basics by introducing the "exceptions to the rules."

    More often than not, the UV seams will require a smoothing split. Surfaces like cylinders, spheres, and other elements that loop back around and meet with themselves should have smoothed edges. Either way, one should be testing his bakes to make sure they come out properly.
  • EarthQuake
    Options
    Offline / Send Message
    Nosslak wrote: »
    When making hard surfaces they are mostly the same but there are instances where all UV splits shouldn't be hard like on these:

    Why?
    Or on organic models.

    Again, why?

    If you're using baked normal maps, the normal map will account for both of these situations. I use simple scripts to set hard edges from uv seems for basically all of my models, and I never go back and soften the seam edge on cylinders, because it generally doesn't matter.

    The only situation where I've ever had an issue with it was specific to LODs.
  • Nosslak
    Options
    Offline / Send Message
    Nosslak polycounter lvl 12
    My reasoning was that the normalmap should do as little work as necessary (without making the model more expensive to render) as that lowers the amount of possible errors (due to tangent synching, mipping, compression, etc.). I guess we work a bit differently as you first make your UV-splits and then your smoothing splits whereas I split the other way around. When I model I always make my smoothing splits first, then usually run a 'Select Similar' command (Blender) on my hard edges and mark those for UV-splits as well so I never run into a situation where I would need to back and remove smoothing splits again.

    I suppose both methods work but one will result in a normalmap with a few more (albeit small) gradients and therefore a greater (still small) chance to look worse. In-game the models would probably look the same so it wouldn't matter, but technically I'd say my method would result in a normalmap that would be a tiny bit better (while, for me at least, not yielding any additional work).
  • EarthQuake
    Options
    Offline / Send Message
    Actually I do both at once, I set my hard edges and my uv splits (at least in my head) while doing the UV layout. I find the two so dependent on each other that its the most logical way to go about it. I lay everything out, but before doing the final packing I will do test bakes to make sure my shading works well, and adjust seams/smoothing if needed, and then do the final pack.

    I find if you set your smoothing first, you may end up with far too many UV islands, and if you don't think about your smoothing while doing UVs, you may end up with too few UV islands (and smoothing errors as a result).
  • unscodst
    Options
    Offline / Send Message
    I read both of EarthQuake's posts, as well as watched a video from Racer445 at CGTuts. I feel like I understand more but with that brings more questions.

    Lets take my test model for instance:

    2zScCln.png

    Now I understand why Hard Edges are a problem when normal mapping. But what if you want those hard edges? I understand that you put everything into their own UV Island and give it a smoothing group but in my test case my Low Poly only has 6 polys so I'm a little confused about how I would go about this.

    Is my problem that my Low Poly doesn't supply enough polys for the High Poly to be projected onto it, as explained in Earthquakes "Understanding Averaged Normals..." post? Lets looks at my Low Poly with a Normal Map and my High Poly side by side.

    yXNQq6K.png

    As you can see some sides worked while others didn't. The Top of my model, the middle most picture, looks pretty much exact. Same with the left side as nothing was done to it. The right side which was a positive Bevel looks right as well.

    Now the Front, the part just under the Top, doesn't even show detail. This was a negative bevel. The Bottom, lowest picture in the group, has some parts correct and some not. It seems the upper right and lower left quadrant of the Bottom section show up the best as well as the quadrant boarder. But the opposite quadrants are messed up. Same with the Back, the upper most picture. The third section from the left is almost perfect, but it looks like the Normal map just gave up on the other 5 sections.

    Now everyone said that I don't need to unwrap my High Poly. So what would I need to do to my Low Poly to make hard edge features stand out, as well as getting my other features to look correct throughout, like fixing my Back poly.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    If you want to lose the hard edges, you make your HP the way you want your LP to appear. The high poly you are using still has sharp corners with no chamfering at all, so that's what will get baked down into the normal map.

    A HP with rounded corners will bake into the normal map for the LP, thus causing the LP to appear to have rounded corners, despite having a smoothing split.


    xNormal.png

    The left cube is my (messy) HP. I threw in some supporting edge loops and applied a turbosmooth to round out the corners. The closer the supporting edge loops are to the corners, the sharper the corners will be.

    The center cube is my LP with the resulting normal map applied, and the right cube is my LP with no textures.

    I decided to avoid creating an indent on my LP for the front face because it doesn't affect my silhouette. Notice, though, that I added in some geometry at the top for where the high poly pushes out, because that part of the model contributes to the silhouette of the shape. If I were to use just a cube for my LP, there would be distortion due to the surface inconsistencies. The reason some of your normal details appear shifted on the sides is due to a sort of parallax distortion. Imagine observing the needle of a gauge from one side rather than straight on. The needle will appear to read the wrong value from that perspective. When baking normals, a similar effect happens if you don't have enough supporting topology on your LP to match the HP; your normals are basically baking from a poor perspective, the perspective being the vertex normals. There are no vertices between the corners, so any non-flat details will become skewed. This picture from Earthquake's thread is a good example, you can see how the details are stretched depending on how the vertex normals face:

    waviness06.jpg

    So the short answer is yes, you need more detail in your LP model. All those parts on your HP that are extruded and affecting the silhouette of the object need to also be there in the LP. Of course, it all depends on the size of the object, the importance an element plays on the silhouette, etc.

    If you add a vertex at the center of each of the extruded/chamfered square bits protruding from the sides, your bake should come out a bit better, but you may want to consider just matching the HP topology more closely in general.
  • unscodst
    Options
    Offline / Send Message
    Awesome, thanks I'll work on that sometime today and see what I get.
  • unscodst
    Options
    Offline / Send Message
    Here is my update:
    hukGWtJ.png

    Starting from the Top Left image. This is the most reduced and triangulated I could get my Low Poly before is turned into a 6 poly box. The Top Right is a set up from that, though through my trials I must have over written that model.

    The Lower Left takes out most polygons from every side while leaving enough to get most of the features to show. So for the set of 6 small squares they take up 18 polys each but is reduced to 10, which isn't much. The Lower Right picture is a direct copy of the High Poly with every side flattened.

    Doing this allowed to see that more intricate sides, like the set of 6 squares, should have more polys. While the Top face, because it is chamfered, only needs one poly, which is what I gathered while I was reading.

    I still have a question about the Cage though. For one it seems like the Cage only works properly if I use a Push modifier. If I try to move the faces myself it doesn't work right. Why is this or am I not doing something right?

    Secondly, just to make sure, when I export the Cage with xNormal I am supposed to be exporting it as a Low Poly with export cage unchecked?
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    I still have a question about the Cage though. For one it seems like the Cage only works properly if I use a Push modifier. If I try to move the faces myself it doesn't work right. Why is this or am I not doing something right?

    Cages control how the high poly details are transferred to the low. So when you use the push modifier, it sends the verts out in the direction of their normals. This gives a nice average between all of the verts.

    If you move the faces/verts/edges by hand, you are now not averaging, you are artifically affecting the bake. You can change the cage by hand, but you have to do some practicing first to understand how changing the cage will influence the normal map.
    Secondly, just to make sure, when I export the Cage with xNormal I am supposed to be exporting it as a Low Poly with export cage unchecked?

    Yes, export your cage as a seperate file. And import it as a seperate file within xnormal. The checkbox is if you have a workflow that can read the low poly and the cage as seperate elements within the file format.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    ERROR:: DOUBLE POST

    c:/del /brain
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Using Push allows for equal distribution of inflation across the cage model. You should do this first to cover as much of your model as you can, then if there's anything left uncovered in tight spots you should manually tweak those areas. You don't want a "crooked" cage so to speak. It's all about that perspective I described in my last post.

    I would suggest applying what you have learned so far to an actual model. It doesn't have to be a huge project; just something small, like a simple prop.

    As for your second question, I usually just export the LP and cage separately as FBX files.
  • Nosslak
    Options
    Offline / Send Message
    Nosslak polycounter lvl 12
    unscodst wrote: »
    I still have a question about the Cage though. For one it seems like the Cage only works properly if I use a Push modifier. If I try to move the faces myself it doesn't work right. Why is this or am I not doing something right?
    I'd say that's presumably because the triangulation changes when you modify the model yourself. I'm using Blender so I can't tell for sure, but when I make cages (in Blender) I need to apply the triangulation before I scale up my cage as otherwise the topology might change (and the cage and lowpoly model needs to match exactly).
  • unscodst
    Options
    Offline / Send Message
    I have some other models I am about to do this to.

    I also forgot to ask. Do I triangulate the High Poly and Low Poly or just the Low Poly?
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
Sign In or Register to comment.