Home Technical Talk

My thoughts on Normal Baking by with UV matching

8440428390_3efd80fa4a_b.jpg

My thoughts on Normal Baking by with UV matching.

Another post here in Polycount talked about the difficulty in baking perfect normal maps for models with low poly holes and tube shapes. But it didn't address an important alternative IMO. (I didn't see it in the wiki)

A way I go about avoiding distortions is by matching the model in UV space and baking with xNormal instead of using a cage or a broken cage (don't attempt this last one at home as you'll never get nice transitions). The main idea behind baking is that you need to be careful matching you hi and low poly, but some things are impossible to match up. Just think about it: How do you project or transform an hexagon so that it perfectly overlaps with a circle? You get to the conclusion is not a mater of tweaking the cage.

8441636668_d1c6e9d28e_b.jpg

In UV matching the circle is mapped as a polygonal shape, this is done by choosing linear interpolation of UVs when you subdivide.

8441637248_a4d041e7a2_b.jpg

The question that interested me is: How much better is it to bake this way?
Lets do a comparison:

Normal map UV-Matching
8441314804_406a412426_b.jpg


Normal map Cage
8440222209_26befd9f11_b.jpg


UV_Matching
8439337061_9f22535c70_b.jpg
8440427430_7eb2ee7f66_b.jpg


Cage
8439338015_08bd284c69_b.jpg
8440428346_b6732a8603_b.jpg


UV_Matching
8440428540_5af5f2e3d0_b.jpg
8440427262_e0a608bd21_b.jpg


Cage
8439337031_5bcf7fdb24_b.jpg
8440427770_cf27440bc7_b.jpg


I find that the uv matched object is presented in a more convincing way. From every angle it looks the same when it moves. You can imagine better how it would feel to have it in your hands. However the object you see is not the highpoly but a smoothed version of the lowpoly. You never think the hole is actually cylindrical, whereas in the cage-baked one, you are presented with the illusion that you are seeing the highpoly. The problem is that the illusion breaks when you have a silhouette that is too different or when you view it from an angle that is too different to the direction it was projected with the cage.

How can you make UV matching highpoly and lowpoly?
If the thought of manually matching them makes you feel like baking your computer in the microwave or something, you should never do that.
Consider if you really want to bake with uv matching in the first place. The basic reason you get that strange distortion in my example is because an octagon is not a circle no mater how strong you think about it or bang your head against the keyboard. So either make an octagonal shape on your highpoly or invest more geometry on your lowpoly.
If you still want to do uv matching consider if only part of the model needs to be done that way, maybe the wheels of a car can be done with uv matching by themselves, for example.

The way uv matching comes natural is when the highpoly and lowpoly come from a same object. Then you only need to uv map that source object and make sure the uv mapping is preserved. This is the case with smoothed models or sculpted models. Just remember to prevent the UVs to be smoothed and be aware of target weld and other operations that modify the UVs .

Here is an example of another test model where I did the high poly independently and then made another highpoly with matching uvs that wasnt as precise. Then I projected this last one onto the precise first highpoly. I actually prefer the result I got from baking with the cage on this model.

Cage
8440222787_751df9ed78_z.jpg

UV-Matched
8440222741_39d35c12ac_z.jpg

Wireframe
8441315246_afcf5c0c62_z.jpg


Tell me what you think and if you feel like it have a look at my web page. www.nicolasmagee.com
(the server that it is on is a bit unreliable try 2 times if it doesn't work).
I'm a student at the moment but I want to be part of the 3D community here as I see so much awasome work being done, and it really inspires me.

Replies

  • EarthQuake
    Options
    Offline / Send Message
    The main problem with this method, or a similar method someone else posted a while ago(where they take the lowpoly and bevel edges to create the high, but keep the silhouette the same to avoid waviness) is that your edges will always look like jagged lowpoly models. When you get some slight waviness in there, it will at least look rounder from some angles.

    Also, when dealing with extremely low polycounts, there is a bit more to think about:

    Why is the object such a low polycount to begin with? Generally assets with very low triangle count are either very unimportant assets or very small. Truly lowpoly work in most cases won't be using normal maps at all. So in reality its a lot of fussing over a problem which is not really a problem in actual use. If your model is so low poly that wavy edges or whatever are a big problem, adding more geometry is always going to be the best solution as it will reduce waviness while also improving the silhouette of the model. With your examples here, sure there is less waviness, however the extremely lowpoly silhouette of your test models just looks bad. The second example with more sides to the cylindrical shapes, the difference there isn't really noticeable, certainly not worth the effort of UV matching.

    With modern hardware triangle count is not as important as it was in the past (draw calls are generally much more important), so if you have an important asset that will be viewed up close, you should take the time to model in geometry there to look good. Keep in mind that optimizing a mesh below say, 500 triangles gives you no real benefit on modern hardware. Your draw count and shader cost has a much bigger impact on performance at that point. With current PC hardware and next gen consoles, triangle count will be even less of an issue.

    So for the cylinder example, there is just no reason you would ever use that little geometry for a singular asset. If you ended up using 6 sided geometry on a more complex asset, those pieces would be very small and of little importance.

    The sword asset, if that was something held by a character in a game, you would use a lot more geometry to make it look good.

    The cut out cylinder shape, again the difference between the two methods isn't apparent when you're using a reasonable amount of geometry to represent the shape.

    At the end of the day, matching uvs on high and low is just a big pain in the ass, especially with a complex asset where you might have 40 or so unique UV islands, or sculpted high resolution meshes where uving isn't feasable, so its really time consuming and generally not going to be an option in production.
  • niic
    Options
    Offline / Send Message
    Hi EarthQuake,
    Thanks for the quick reply. I have to agree with what you say. Specially about adding geometry to make things look better. It is only a test object to demonstrate. Your post made me wonder if there is a place for uv matching at all. I can think of situations where is faster to do uv matching than setting up a cage. For example if you have a low poly and you use it directly to sculpt on it on Zbrush or something. If your object is full of fingers, spikes, tentacles or things like that uv mapping can be easier as it can even bake intersecting geometry.
  • EarthQuake
    Options
    Offline / Send Message
    niic wrote: »
    Hi EarthQuake,
    Thanks for the quick reply. I have to agree with what you say. Specially about adding geometry to make things look better. It is only a test object to demonstrate. Your post made me wonder if there is a place for uv matching at all. I can think of situations where is faster to do uv matching than setting up a cage. For example if you have a low poly and you use it directly to sculpt on it on Zbrush or something. If your object is full of fingers, spikes, tentacles or things like that uv mapping can be easier as it can even bake intersecting geometry.

    Yeah there is some potential in that case, however in most situations you will:

    A. Create a "cage" mesh that is optimized for sculpting, this means even, square shaped polygons for the best subdivision.
    B. Sculpt your highpoly mesh
    C. Retopo your high into an optimized game mesh, the sort of topogoly you want for a sculpting "cage" mesh and a lowpoly mesh are generally very different, so you're going to have to alter/redo your uvs anyway.

    You may start C from A, but still, you will almost never be able to retain the same UV layout, unless you sculpt directly from your lowpoly model and then bake it back onto there, but this can be very restrictive and is something I wouldn't really recommend, as the shapes of your model tend to change quite a bit when you get to sculpting.

    I don't mean to poop on your parade here, just pointing out the differences between the theory(which is reasonable enough) and the concerns you run into with actual creation/production of assets.
Sign In or Register to comment.