Home Technical Talk

Normal mapping seam on mirrored UVs

polycounter lvl 6
Offline / Send Message
fullchaos13 polycounter lvl 6
After baking a normal for this mesh which has mirrored UVs down the middle I get a very visible seam in the location of the mirroring.

After reading up online about this problem most people suggest to offset the mirrored half of the UVs so they don't overlap in the 0-1 to area. I'm finding this really confusing and I attempted to do this but alas I failed. Here was my process:

Step 1: Bake a tangent space normal map with the two UV halves overlapping each other.

Step 2: After baking offset the mirrored UV half so it falls outside the 0-1 area (Offsetting by 256 units which is the size of the area). Problem with this is 256 units correlates to a full offset, and in Blender anything outside of the UV area simply wraps back around so it's the same as it being perfectly on top, and thus the seam remains.


Now I'm assuming my interpretation of step 2 is incorrect and I'm doing it absolutely wrong. The software I'm using is Blender + xNormal. If anyone can please educate me on how I should be doing this it would be greatly appreciated!

Replies

  • Fuiosg
    Offline / Send Message
    Fuiosg polycounter lvl 5
    the topology is a bit weird. But...
    Step 1: Bake a tangent space normal map with the two UV halves overlapping each other.
    You're baking with the two UV sets on top of each other? If so that will screw up your bake.
  • fullchaos13
    Offline / Send Message
    fullchaos13 polycounter lvl 6
    Fuiosg said:
    the topology is a bit weird. But...
    Step 1: Bake a tangent space normal map with the two UV halves overlapping each other.
    You're baking with the two UV sets on top of each other? If so that will screw up your bake.
    Yes the topology is indeed weird, just simply threw together a quick test mesh to demonstrate my situation.
    I just tried baking with it only half the mesh/half the UVs and the seam running through the middle still persists. 
    This is an old polycount thread where someone had the same problem and managed to get a fix by applying that technique: http://polycount.com/discussion/53006/how-do-i-fix-mirrored-uv-seams-in-a-normal-map
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    You're mixing up the steps. You need to offset first and then bake. Otherwise, as @Fuiosg said, you will get Z-fighting. This is when the rays are being cast onto both sets of UVs because they are sitting in the exact same location.

    Did you check that the UVs are not inverted when you baked half the model?(other half deleted)
  • fullchaos13
    Offline / Send Message
    fullchaos13 polycounter lvl 6
    You're mixing up the steps. You need to offset first and then bake. Otherwise, as @Fuiosg said, you will get Z-fighting. This is when the rays are being cast onto both sets of UVs because they are sitting in the exact same location.

    Did you check that the UVs are not inverted when you baked half the model?(other half deleted)
    Ok just to make sure I'm understanding what you said. First I offset the mirrored UVs by one whole UV editing area (256 units in Blender) making my UV map look like the second picture in the OP, then I bake both halves of the mesh? Also I'm pretty sure that UVs are indeed not inverted. Sadly I still get the seam.
  • Fuiosg
    Offline / Send Message
    Fuiosg polycounter lvl 5
    I can't tell if that mesh is all one piece, or if there is just zero distance between islands. When you unwrap in blender you can pack islands with cntrl + p in the UV editor, and a menu will come up in the 3d view that says "Pack Islands", make sure you set a big enough margin size.

    Also instead of worrying about where the 2nd UV set goes (it just needs to be out of the way when baking) make sure you're doing everything else right. Check out this video.
  • Eric Chadwick
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Ok just to make sure I'm understanding what you said. First I offset the mirrored UVs by one whole UV editing area (256 units in Blender) making my UV map look like the second picture in the OP, then I bake both halves of the mesh?

    You're only baking one half. That's the whole idea. Only UVs in 0-1 will be baked, as outside that UV tile is ignored. So the very reason you're moving the mirrored UVs out of the way is so that they don't interfere with the baking process.

    Further to what @fuiosg said, is that a single UV shell? Because if it isn't you will need some padding to avoid bleeding artifacts.



  • fullchaos13
    Offline / Send Message
    fullchaos13 polycounter lvl 6
    Fuiosg said:
    I can't tell if that mesh is all one piece, or if there is just zero distance between islands. When you unwrap in blender you can pack islands with cntrl + p in the UV editor, and a menu will come up in the 3d view that says "Pack Islands", make sure you set a big enough margin size.

    Also instead of worrying about where the 2nd UV set goes (it just needs to be out of the way when baking) make sure you're doing everything else right. Check out this video.
    Well I feel quite stupid... By spacing out the UV islands the seam down the mirrored section disappeared.

    Appreciate the help guys, and thanks a lot!
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Well I feel quite stupid... By spacing out the UV islands the seam down the mirrored section disappeared.

    That'll be the padding....... ;)
  • beefaroni
    Offline / Send Message
    beefaroni sublime tool
    Heheh ya padding. Just for future reference you can usually get away with 8px of padding at 2048, 4px at 1024, and 2px at 512 (although depending on your target platform you may want 4px at 512).
Sign In or Register to comment.