Home Technical Talk

Problem with baking Normal Maps - Direction seems to switch on every UV-Shell

polycounter lvl 18
Offline / Send Message
Slaught polycounter lvl 18
Hey guys long time no see!

I've been asked by a friend to sculpt detail and later bake out normal-maps for a model of his. Unfortunately I ran into some problems trying to generate the normal-map. I'm using Mudbox 2018 for sculpting and baking but I also baked some normal-maps in xNormal to make sure the problem isn't exclusive to Mudbox with the same result so I'm guessing it's related to the UV-Maps?



Every seam is clearly visible because the light direction seems to change in every single one of them. I've successfully baked normal-maps for my models before so I'm not exactly sure what the problem is.

Hoping someone can give me a few pointers to salvage it, I'd hate to have to redo all the UV's :smile:

Cheers!

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Thats normal. Tangent space normal map coloration will depend on how the uvs are rotated. If you have correct tangent space and smoothing settings, this shouldn't be visible, when its applied as a normal map.
  • Larry
    Offline / Send Message
    Larry interpolator
    in the image on the right with the wireframe, some things are out of your 0-1 uv space. Also you packed them too close, leave some padding between them. Why are you viewing it like this in your viewport? Did you plug this in the diffuse? What seems to you like a problem at this moment might not be a problem if you plug it in the actual normal map slot.
    How can i explain this.... The curve might be straight in your eyes, but in the normal map perspective, it is a curve that changes axis so the colors of the normal map might change.
    What program do you use for viewing it? 3ds max has some issues with normal maps and the viewports, so you have to set gamma correction to 0
  • Slaught
    Offline / Send Message
    Slaught polycounter lvl 18
    Obscura said:
    Thats normal. Tangent space normal map coloration will depend on how the uvs are rotated. If you have correct tangent space and smoothing settings, this shouldn't be visible, when its applied as a normal map.
    Interesting, I always figured it would generate continuous colors even across seams but it makes sense now that I think about it.

    Larry said:
    in the image on the right with the wireframe, some things are out of your 0-1 uv space. Also you packed them too close, leave some padding between them. Why are you viewing it like this in your viewport? Did you plug this in the diffuse? What seems to you like a problem at this moment might not be a problem if you plug it in the actual normal map slot.
    How can i explain this.... The curve might be straight in your eyes, but in the normal map perspective, it is a curve that changes axis so the colors of the normal map might change.
    What program do you use for viewing it? 3ds max has some issues with normal maps and the viewports, so you have to set gamma correction to 0
    Yes I did plug this into the diffuse but just to better show what I thought was the problem. The shot of the UV's is cropped so it may seem like it but I made sure nothing is out of bounds.



    When I check the normal-map in xNormal it does look a lot better but you can still clearly make out the seams...I guess no way around redoing the uv-maps and try to hide them at the connecting parts?

    Just wanted to make sure I didn't have any errors in my UV's, thanks for the replies!


  • ActionDawg
    Offline / Send Message
    ActionDawg greentooth
    Larry said:
    in the image on the right with the wireframe, some things are out of your 0-1 uv space. Also you packed them too close, leave some padding between them. Why are you viewing it like this in your viewport? Did you plug this in the diffuse? What seems to you like a problem at this moment might not be a problem if you plug it in the actual normal map slot.
    How can i explain this.... The curve might be straight in your eyes, but in the normal map perspective, it is a curve that changes axis so the colors of the normal map might change.
    What program do you use for viewing it? 3ds max has some issues with normal maps and the viewports, so you have to set gamma correction to 0
    We're only seeing a cropped view of the full texture, and there is padding. That's the orange outline. It could perhaps use more, though.

    I don't know what you're getting at with curves, and Max can display normal maps just fine if you load the texture with the right gamma, though it will not be the correct tangent basis if you don't bake in Max or convert to Max's internal tangent basis. You don't need to change the whole project gamma to fix a single texture. OP please ignore this, no offense Larry.

    OP, tangent space normal maps are a way of encoding information that tries to take advantage of the very numerically limited range of 8 bit per color channel textures.Since there's not a lot of those values to work with, it wisely only records a degree of change in the surface normal from the high poly model for each pixel. If the high is the same as the low at a given pixel, record that as "nothing". This is "normal map purple". Where they diverge, record the degree of change as positive or negative in the XYZ axes.

    As Obscura says, this is dependent on how the UVs are rotated. This is due to the fact that tangent basis normal maps are only a step in the full process, and are typically translated back to world space (there's also object space, but let's ignore that as it's functionally the same in this context) when the shader begins to work with it for lighting calculations.

    At the risk of getting too complicated:
    If you were to bake the same models as a world space normal map you would see no "seams" like you see currently, because it is an absolute frame of reference vs tangent space which is relative to your low poly model and the texture's 2D coordinate plane. So "up", the green channel, in 2D for tangent space is always consistent: moving along the y-axis in your texture. This ultimately gets un-rotated (essentially) when translating back to world space for doing lighting calcs. To see this visually: if you were to bake a world space normal map, you would see that "up" can now go in random x AND y directions in the 2D coordinate plane now.


    Above is a tangent space normal map and a world space normal map. Below is the green channel isolated.

    How this relative frame of reference is generated, known as tangent basis, differs slightly from program to program as well, so you have to be aware when dealing with tspace normals. The most common and widely supported one is MikkT, but Max does not natively use it.

    TLDR; It's working just fine, but I'd probably not bake with Mudbox unless you know your tangent bases are correct between the baker and the renderer.
  • Larry
    Offline / Send Message
    Larry interpolator
    @somedoggy
    None taken, i found out that 3ds max shows normal seams even if the texture is seamless. Playing with the gamma never worked for me so i turned it off completely. I never trust 3ds max viewport anymore for such matters, i test it directly in UE4
Sign In or Register to comment.