0
$\begingroup$

Stacking UVs helps save texture space and give your objects more resolution in game engines. But is baking stacked UVs in Blender possible? Yes, it is!

First, make sure to combine all objects that share that material into ONE object, otherwise each island will bake and bleed separately on top of each other, making a mess, instead of baking as one seamless pattern.

Second, make sure that no UV island is folded over itself. The best way to envision this is by thinking of UV islands like flat pieces of paper. You can stack a whole bunch of flat pieces on top of each other, but as soon as you stack a folded piece you will get bake errors! These problems can sometimes occur by using the "Project from View" options when unwrapping, where the front and back of the object will be occupying the same UV space, essentially creating a "folded" UV island.

Third, make sure the objects that share the same material have the same Texel Density. While this is NOT required to make a good bake with stacked UVs, it is required if you want your material to look consistent across all those objects. Use the Texel Density Checker addon to set your UVs to a consistent size.

Now, if you are just baking color, then you're probably fine, and you shouldn't get any seams in your bake. But what if you are baking normal maps that are stacked on top of each other? Well this is where things can get tricky. Keep in mind that items which should have different normal map details should NOT be stacked (for example, if you sculpted different clothing creases in your character's shirt sleeves than in their collar, then you should NOT stack those UVs on top of each other, even if they share the same material).

However, for any area where it's okay to share normal map details keep on reading to find out how!

First, here is an example problem, the very problem I had encountered:

"When baking the base color for my character, everything works perfect, and I get one seamless pattern in my texture atlas, despite the stacked UVs. However, when I try to bake the normal map, the character's normals are taken into account where I have physically modelled seams or pleats, and thus those unwanted details show up in the bake, breaking the seamless pattern of the texture. Is there a way of subtracting the character's normals from the texture's procedural bump map, so only the texture's normals show up in the bake?"

An example of a BAD bake with stacked UVs:

Bad Normal Map_Stacked UVs_Blender

$\endgroup$

1 Answer 1

0
$\begingroup$

SOLVED!! I want to thank the Lord Jesus Christ for showing me a wonderful solution to this issue, and I'd like to share it with all of you. There are a couple of ways to deal with baking normals on stacked UVs:

  • For any stacked UVs that are ALL identical and perfectly aligned on top of each other (ie. from a mirror modifier), you shouldn't have any issues baking the normal map by selecting your Bake Type to be "Normal" and hitting "Bake". For example, the UVs for the hands in the image below are identical and stacked, and they bake without issue:

Stacked UVs are okay

  • For any stacked UVs that are NOT identical, and their material uses a bump map, but their UVs are very well laid-out with minimal to no stretching, you should be able to bake the normal map with Bake Type set to "Normal". This scenario is represented by the objects on the far left in the image below.

  • For any stacked UVs that are NOT identical, and their material only uses a pre-existing normal map (not a procedurally-generated bump map), you can just Ctrl-Shift click on the Normal Map texture (with Node Wrangler addon enabled) and then select "Emit" in the bake settings and bake the normal map as non-color data. Otherwise, doing a regular "Normal Map" bake may result in seams or natural bumps in the geometry showing up. Notice the difference after baking an Emit pass of just the material's normal map (the color only appears lighter because the fine detail of the 4K texture was scaled down to 1K for this sample image):

Fixed Normal Map_Bake_Emit_Stacked UVs_Blender

  • For any stacked UVs that are NOT identical, and their material uses a bump map, you may notice some "seams" appearing in the baked image along the real UV seams (as shown in the top part of the image above). This is most noticeable along any UV island edges that have some stretching, and becomes VERY noticeable if your normals are not too strong (not very bumpy). You can fix this by baking a perfectly flat proxy with your material applied, rather than the stacked UVs of your real object!

1. In edit mode, with your source UV map selected, add a plane to your object that you are trying to bake, and scale it to be at least as wide as your object (you will need to tweak this size later in Step 4).

Fix stacked UVs in Blender Part 1

2. Now in the UV Editor, with your source UV selected, use the Texel Density Checker add-on to calculate the TD of the widest UV in your object. After doing so, press "Calc -> Set Value" to copy that value to be the active Texel Density.

Fix stacked UVs in Blender Part 2

3. Next select your plane's UV map and press "Set my TD" to set the Texel Density of your plane to match your original object.

Fix stacked UVs in Blender Part 3

4. If the plane's UV map now becomes too small to encompass your original UV, then scale the plane's UV up again until it just covers the widest part of your original UV, and pay attention to the value you scaled it by. Now physically scale the plane's geometry by the same amount. This will ensure the same Texel Density you selected earlier is maintained.

Fix stacked UVs in Blender Part 4

5. Now you need to copy the plane's UV into the UV map you will be using for baking. Make sure MagicUV is enabled in the addons. Press "U" in edit mode with only your plane's geometry selected. Choose "Copy / Paste UV" > "Copy" > and select your source UV map.

Fix stacked UVs in Blender Part 5

6. Now press "U" again and choose "Copy / Paste UV" > "Paste" > and select your baking UV map. In Blender 3.1 you will get a python error message, but don't worry, everything still worked, you just need to exit edit mode and re-enter.

Fix stacked UVs in Blender Part 6

7. With the plane's UV copied in, you will need to scale it to the same equivalent texel density it had before. If your baking UV is going to be using a texture atlas, there's a good chance your texel density will be lower than in your source UV. If you already had the original object's UV scaled to the right size in your baking UV map, then you can use that as a reference. Select one of your object UVs in the source UV map, measure the TD and write it down. Select your plane's UV in the source map, measure the TD and write it down.

Fix stacked UVs in Blender Part 7

8. Now go to the baking UV map, select the SAME object's UV you had previously measured, measure it again, and write down the TD value. Now you only need to find the TD value for the plane to use in this baking UV map.

Fix stacked UVs in Blender Part 8

9. Find a ratio calculator online (like from CalculatorSoup) and input the first two TD values you wrote down from your Source UV map (Plane TD : Object TD), then leave the next slot blank (we will be solving for the Plane's new TD) and in the last slot input the Object TD from the Baking UV map. Hit calculate.

Fix stacked UVs in Blender Part 9

10. Copy the answer and paste it into the Set TD box in the Texel Density Checker add-on in Blender. Now with your baking UV active, and the plane's UV selected, hit "Set my TD". Make sure the plane's UV fully encompasses the original object's UV.

Fix stacked UVs in Blender Part 10

11. Now, subdivide the plane a bunch of times (I used 30 times). Enter Face select mode, turn on "UV sync selection", and in the UV editor brush select over any faces that are not needed to fully cover the shape of the original object's UV map.

Fix stacked UVs in Blender Part 11

12. Delete these unneeded faces in the 3D view. You can also add loop cuts where needed if you need to crop in tighter and avoid overlapping any existing UVs in your baking UV map.

Fix stacked UVs in Blender Part 12

13. Finally you can separate this plane from your original object (P > Separate by Selection), and then bake the normals on it into your baking UV map (using "Bake Type" set to "Normal"). Now when you use that baked map on your original object, the normals will show perfectly on your stacked UVs without any seams! I hope this info will help someone who was struggling with this issue as I was. :-)

Fix stacked UVs in Blender Part 13

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .