Home Technical Talk

Normal map seams

I have been having problems with normal maps going a bit crazy at the UV seams.
I'm trying to make some pants that use the normals for the folds in the fabric. I modeled it in Max and unwrapped it, exported an obj that I picked up in ZBrush to make the normal, that I sent back to Max. This is what happens when i apply it.Pantsrenderd.jpg
I figured it may be a problem with the normal maps so I used that as a diffuse to check that everything lined up. A few things are off but nothing that would cause what is above. I would like to know how to fix the inverted red in some parts though. Like just above and blow the leg belt.
PantsNormaldif.jpg
It looks fine in zbrush
PantsZBrush.jpgAnd because I'm sure someone will ask for it, here is the normal map with the UV. Forgive my unwrapping skill (or lack of) Still kind of new to it.
PantsUV.jpg

(Can you see the images now?)

Replies

  • David Wakelin
    Options
    Offline / Send Message
    Hi,

    Like yourself I'm a student too and again about the same amount of work experience in 3D so dw were all beginners to start with!

    I can't load up the images on my iPhone but I believe - I've had the same problems in zbrush myself that the normal map needs to be flipped - or so my lecturer told me.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Mind posting some images? Unless you did, in which case I can't see them.
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    You should bake it in Max or Xnormal instead of zbrush, for a start. Something that will use the same tangent basis. Beyond that I can't see any of your images either, so I'm not sure what your UVs / etc look like
  • ivanzu
    Options
    Offline / Send Message
    ivanzu polycounter lvl 10
    Cant see the images on pc nor phone so repost them as it hard to help you without the images.
  • Alidium
    Options
    Offline / Send Message
    I must be doing something wrong then. I can see the images fine. I'll see what i can do.


    Cryrid, Baking it in max sounds like it may work. It has when I was testing it with simple shapes, but wont a several million ploy thing crash it? (can't check right now)
  • ivanzu
    Options
    Offline / Send Message
    ivanzu polycounter lvl 10
    Try baking inside xNormal.
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    but wont a several million ploy thing crash it? (can't check right now)
    It may or may not make things a bit more unpleasant. Run the sculpt through Zbrush's Decimation Master. That should at least trim it down to a lighter file size.
  • MagnificentMicrowave
    Is it just me or the X channel is shining from the left?
  • Pivot
    Options
    Offline / Send Message
    Pivot polycounter lvl 6
    Have you turned off your Gamma/LUT settings? When I was baking stuff in xnormal and viewing them in 3dsmax I had a similar weird seam problem, and it was 3dsmax's weird gamma settings giving me some crazy seams.

    Also you can use xnormal to bake, it can handle the millions of polys thing because it doesn't have to render them out in a viewport. If you import that into 3dsmax it will lag a lot, and if you use Decimation Master to export a less intensive version you'll lose out on your details.
  • Alidium
    Options
    Offline / Send Message
    Ok, got xnormal and it is producing some nice maps, better than Zbrush anyway, although the light/dark seam is still there.
    A problem is maxs "up" Z axis. So I assume i need to change the "Swizzle coordinates" in xnormal.
    Also, because I eventually plan to take this in to UDK would the altered map be a problem or will it see it how max did?

    Edit:
    Messed around with xnormal a bit more and got a better normal map with the X and Y flipped so it looks right. But, still got the seam there. Any ideas?
    PANTSbutbetter.jpg
  • Alidium
    Options
    Offline / Send Message
    Pivot, turning off the gamma LUT appears to have helped, but there is still a seam here. This is a normal made with xnormal.LessSeam.jpg
  • 16bit
    Options
    Offline / Send Message
    16bit polycounter lvl 13
    I'm pretty sure that both max's and udks swizzle coordinates are X pos, Y neg, and Z pos.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    Check the normal map compression settings, I just posted something else on them here
  • hiredblade
    Options
    Offline / Send Message
    Was the mesh imported from a game or something?
    Tangent normals are fine. Mesh faces are seperate. Weld the vertices.
  • Alidium
    Options
    Offline / Send Message
    Blade, I made the mesh myself in Max, the high poly in zbrush and the normal in xnormal. I'm not sure what you mean my weld the verts. It's not a seam in the mesh, just in the UV, and if i weld that, I will have overlapping UVs

    Kurt. I am not yet in the game engine. The visable seams are in Max, although I will check it when i take it into Unreal.

    I feel like it is something simple I am doing wrong. I'm going to try the "non-tangent edge UV seam" thing to see if that works.
  • Lord McMutton
    Options
    Offline / Send Message
    Lord McMutton polycounter lvl 17
    You'll lose a bit of the detail, but try drawing a thin line of 127, 127, 255 around the UV edges.
  • ahtiandr
    Options
    Offline / Send Message
    ahtiandr polycounter lvl 12
    maybe try bigger padding in xnormal settings . Also try to use ray distance calculator in xnormal tools. Try to preview your model inside xnormal and see if the problem is still there. It looks like your channels are messed up to me.
  • hiredblade
    Options
    Offline / Send Message
    First Check it without normalmap.
    Then Reset all face normals.
    Fix smoothing groups if there is any trouble.

    And lastly;
    Check the vertexes at the seam area, if they are doubled, weld those.
    let me give you an example;
    doublevertex.jpg
  • Alidium
    Options
    Offline / Send Message
    It has been a while. Didn't have much success so i took a break and did some other thing. But I'm back again.
    Decided to try a bit with a simple shape before I spent much more time sculpting highpolys. Here was my process.

    Made a simple boxy shape in 3DS Max and gave a small champher to the edges.
    Unwraped the object so that the seam was around the center, running along flat faces. All one smoothing group.
    Exported the object as an OBJ for Zbrush.
    Imported the OBJ in Zbrush using the "tools" box.
    Subdivided it a few times to ~million ploys.
    Used the clay buildup brush and smoothing to add a bit of detail
    Saved, and exported that as another OBJ
    Used xNormal; "Closest hit if ray fails" and "Discard back-faces hits" checked on. 16 padding 64 bucket size.
    Back in 3DS Max, applied the normal map as a normal bump to the bump map and assigned it to the low poly.
    Added some lights.
    Mental ray render.

    Ended up with this. (imported the high poly next to it for refrence)
    DemNormalMaps.jpg

    Found this http://www.andrewklein.net/bh/fix_normalmap_seams.html
    It looks like it may solve the problem. Going to try it. Got to get Photoshop on my home computer first though.
    From what I can figure out my problem is because of the way normal maps are made, where the normal map colors are relative to the image, not the UVs. So if I have an edge with a UV seam, where in the normal map one side of the seam is facing up and the other side is facing any direction other that the exact opposite (down), then the RGB colors will not mach up. When the normal map is applied to the object is where the seam appears.
    Problem is i dont know how to get around this other than "HIDE EVERY SEAM EVER". With some objects i just dont see a way that is possible.
    Bit of a strange description, hope you understand it.

    Another new problem is that dark "shadow" on the top of the low poly. It may have something to do with the geometry being too low. But I chaferd the edges to avoid that.
    The more i'm learning the more I'm starting to think that normal maps are terribly impractical for anything that is not a flat surface.
    I have more to add later.
  • Racer445
    Options
    Offline / Send Message
    Racer445 polycounter lvl 12
    make sure your normal map amounts in the slots are set to 100, try flipping the channels etc. editing your normal map in photoshop is NEVER the answer.

    i was going to say make sure you are assigning a normal bump to the bump slot before adding your map, but you already figured that out.

    post your test object max file and i'll have a look at it.
  • Pola
    Options
    Offline / Send Message
    Pola polycounter lvl 6
    I had an issue with seams before, xnormal would cause a visible seam when I baked but maya bakes weren't causing the seam...no idea how to get it fixed in xnormal though. In regards to the top being shadowed when it shouldn't, if its not due a channel needing to be flipped maybe check the vertex normals and see if they are recieving light from the correct direction.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    Normal maps usually work way more easily than this. They're not impractical - you're just doing something wrong, probably some silly mistake that when you fix it you'll go smoothly for a long time.

    How's it look using a realtime shader? Normally game artists don't use Mental Ray for rendering normal mapped meshes (outside of doing texture bakes of course). I know back in older versions (might still not be fixed) Mental Ray couldn't handle normal maps properly - http://forums.cgsociety.org/showthread.php?t=519721


    If using a proper realtime shader doesn't fix it, could you post your test mesh and the normal map? In Max format would be best so we can just look at which setting you've got wrong.
  • Alidium
    Options
    Offline / Send Message
    Not sure how to use a realtime shader. But I went back and checked renders in ray trace. Still the same result as mentalray.

    Hope I did this right. Here is the test project file (with the high poly)
    http://dl.dropbox.com/u/51192948/NormalTestAlidium.zip

    It may be a bit big, so here is one with just the Max file and Normal map.
    http://dl.dropbox.com/u/51192948/NormalTestAlidiumTwo.zip

    Thanks for the help agian.
  • hiredblade
    Options
    Offline / Send Message
    after giving a look at the last image, I have doubts that you assigned correct uvw space to normalmap. Similar results can be achieved by using a tangent space map at object space mode, as an example.

    Also why do you use xnormal to bake maps? I know that zbrush can do it.
  • Alidium
    Options
    Offline / Send Message
    Apparently x normal is better. From what have tested, it is. It makes more clear normal maps. When I did it in zbrush they were all kinda faded and not sharp.

    Won't object space cause problmes if the object moves?
    How would I have incorrectly set my uvw space up? I unwrapped it, then I made the normal map on to the unwrapped object. It should line up almost perfectly.
    oh... or did you mean in the material editor. I made sure to plug a "normal bump" box into the bump map, and then plug my normal map.tif into the "normal" box in the "normal bump".
  • hiredblade
    Options
    Offline / Send Message
    80627677.png

    You may have set it correct, also try channel directions as a last advice.

    Other than that, i dont have any ideas about what could be the problem.
  • Racer445
    Options
    Offline / Send Message
    Racer445 polycounter lvl 12
    Alidium wrote: »
    Apparently x normal is better. From what have tested, it is. It makes more clear normal maps. When I did it in zbrush they were all kinda faded and not sharp.

    Won't object space cause problmes if the object moves?
    How would I have incorrectly set my uvw space up? I unwrapped it, then I made the normal map on to the unwrapped object. It should line up almost perfectly.
    oh... or did you mean in the material editor. I made sure to plug a "normal bump" box into the bump map, and then plug my normal map.tif into the "normal" box in the "normal bump".

    i opened your file--your red and green channels are swapped, and both red green are flipped. in the "normal bump" slot check off all the "channel direction" checkboxes and render, it should look fine. you should change your swizzle settings in your baker from now on so you don't need to do this, though.

    jeez, people around here really over-complicate their solutions.

    regarding what makes the best looking normal maps; really you should be baking with whatever has math that matches your renderer the closest. for example, max in max, maya in maya etc. check this out if you want to know more: http://wiki.polycount.com/NormalMap#Tangent_Basis

    also don't use TIF files for your maps, use TGA like everyone else. :)
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    You also have a bad normal bake because you've baked your meshes in different positions. The highpoly is about 9 units off in the Y direction so your map looks nothing like the actual highpoly:

    2sxcD.jpg
    CYDEO.jpg

    Next time you're making your highpoly make sure that you don't use the move tool to move it around - just rotate and pan the camera around it.

    Grab a good realtime shader and use it, if you don't know how to do it then watch this.
  • lancemaker
    Options
    Offline / Send Message
    hello, im new here in this forum. But if u search a lil bit you will find a great discussion started by a guy that worked at brink. He showed the way to bake perfect normal maps. Its not only about the program you will use there is a whole method that start at the way you will design the high poly model. i will search here and see if i can find it.
  • lancemaker
    Options
    Offline / Send Message
    here is the link, it does not cover seams, sorry it was my mistake. try using xnormals, fix your tangents. Fixing normalmaps at photoshop is the last thing u should do.
    http://www.polycount.com/forum/showthread.php?t=81154&highlight=brink
  • Alidium
    Options
    Offline / Send Message
    Attempted flipping green and red and switching them around and rerenderd the normal map with the highpoly in the right location. Ended with the same result.

    If i understand this correctly (and i probably dont) from the link racer posted
    When you look at a tangent-space normal map for a character, you typically see different colors along the UV seams. This is because the UV shells are often oriented at different angles on the mesh, a necessary evil when translating the 3D mesh into 2D textures. The body might be mapped with a vertical shell, and the arm mapped with a horizontal one. This requires the normals in the normal map to be twisted for the different orientations of those UV shells. The UVs are twisted, so the normals must be twisted in order to compensate. The tangent basis helps reorient (twist) the lighting as it comes into the surface's local space, so the lighting will then look uniform across the normal mapped mesh.
    Then this should "fix" itself when in a normal map because the way it works with UVs or something?Seams.jpg

    Also went and got that shader, installed it and applied it to my object and got this, crashing max soon after.

    RealTimeShade.jpgWhile I was installing it i got some error about drivers, but then it said it installed successfully.

    I would update my drivers except that will cause my computer to be unable to run more than 10 minuets at a time, but that is another story.

    Kurt, Do the normals have viable seams when you apply them as a diffuse map? it looks like you got rid of them just by using the shader, but i cant do that right now.
  • Racer445
    Options
    Offline / Send Message
    Racer445 polycounter lvl 12
    Alidium wrote: »
    Kurt, Do the normals have viable seams when you apply them as a diffuse map? it looks like you got rid of them just by using the shader, but i cant do that right now.

    this doesn't matter. normal maps are a purely mathematical calculation, and what might look funny on the maps may look perfectly fine when displayed on the model.

    here's your existing mesh and flipped/swapped bake displaying with no seam in both max scanline and standard DX viewport. keep in mind it looks fairly messed because when you baked it, the mesh was offset a bit as mentioned earlier.

    baking1.jpg

    gamma/LUT correction was on inside the file, so i turned that off. i moved your high poly over then i just created a routine baking setup in max using your meshes, and everything went smoothly. here's my file, you can just plug in the map and have a look, or select the low poly, unhide all, and bake a new normal map.

    feel free to export to xnormal if you want as well. MAKE SURE you export the projection cage as well to make sure it uses an averaged cage, not split.

    http://dl.dropbox.com/u/1725586/crits/goo1.rar

    baking1%20copy.jpg
  • Alidium
    Options
    Offline / Send Message
    So I turned off lut/gama again, exported the low poly with the projection cage and recenterd the high poly again. Rendered it in xNormal and put the normal map back on in Max.
    And...
    ITWORKSWOO.jpg
    No seams!
    But not so fast!
    When I attempt to use Max to make a normal map in the render to texture i get this abomination.
    NormalMax.jpg

    I'm going to mess around in the render to texture in Max a bit more. I know that have had it work before. Although insight you may have on why that happened would be nice.

    When I rendered the normal map in the Max file you gave me racer it worked great. Just stuck it on the object and it worked. Also how did you get the normal maps to appear in the view port?

    So I think the main part of the problem was the lut/gama. Turning that back on brings back those seams. But back when I was working on the pants I had the lut/gama off at one point and there was a slight seam there.

    So progress yay!
  • hiredblade
    Options
    Offline / Send Message
    I suggest studying normalmapping from scratch.
    The last one seems like a cage/raycasting problem to me.
    otherwise you have some overlapping uvws.
Sign In or Register to comment.