Announcement

Collapse
No announcement yet.

Normal map artifacts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Normal map artifacts

    Hi, I have some strange artifacts with my normal maps.
    The normal map is done with xnormal and the model with 3dsmax, and was baked with a single smoothing group.

    The artifacts comes from the normal map, as you can see in the material editor.
    But the normal map image seems to be clear and fine..

    I've tried changing the normal map to uncompressed and the artifacts dissappear, but It's supposed that I should use compression, shouldn't I?

    Any idea?







    #2
    I'm no expert on compression but I know that with compression the thing that suffer most is pure gradients. So in your case here because your low poly model has a single smoothing group, the normal map has to do a lot to compensate the shading back to a flat shading, which means heavy gradients in the map. So, in stead of messing with compressions or that stuff, rather sort out the smoothing groups first to get a cleaner normal map and then after that it's possible the compression won't have much impact anyway. But even if it did, then you have a better starting point to try sort that out.

    Comment


      #3
      Thank you obihb, that makes sense for me.
      I thought that I could use 1 smoothing group for that kind of objects with hard edges (not at all, in some corners the edges are beveled).
      What you said is the same that I've been reading in other forums. For this sort of models is better to make different smoothing groups.
      But this would increase the vertex count and other artifacts from the seams, I believe..

      Sometimes you don't know what is better: Use normal map compression or increase vertex count with the smoothing groups, increase polygons or vertex counts,...

      Comment


        #4
        That is true. Normal maps by their nature are just a way to "cheat shading". It's always about trade offs. Polygons vs texture. But the more you work on these kind of things the more you mess with various ways to do essentially the same thing, the more you realize what works better for various situations.

        Comment


          #5
          Meshes that use the normal maps, like this one, are supposed to use a single smoothing group. If you need to remove those gradients you need to add more edges, that will smooth the vertex normals and in result the tangents. You can do it manually or use a bevel operator. Alternatively you can paint it in photoshop or similar app.

          Note that this particular problem is specific to tangent space normal maps only.

          Comment


            #6
            The edges in the Low Poly mesh are beveled except for the back of the mesh because It won't be seen. Mslaf do you believe that I should bevel it too?




            Comment


              #7
              Originally posted by styx3d View Post
              The edges in the Low Poly mesh are beveled except for the back of the mesh because It won't be seen. Mslaf do you believe that I should bevel it too?
              To make things simple: the gradient effect occurs, if the angle between two vertex normals is different. Unhide the vertex normals in the 3d app you use to see if they are parallel or not. As obihb mentioned before, gradient is a compensation or a difference between those two angles saved in the normal map. It's saved in the texture, because there are no other vertex normals in between that could hold this information. If you add additional edges, you add additional vertex normals and this way you may reduce this effect.

              Default:



              With additional edges:



              The gradient effect will still exists but its range will be reduced so it will be barely visible - see the red markers. The disadvantage is, that you have more geometry you need.

              You can create additional splits, bake normal maps and remove them before exporting. Consider this, as a more convenient alternative to baking normal maps and then removing gradients in photoshop. You got the same result + some time for a beer or two

              Using smoothing groups does (or rather should do) the same, but because they MAY affect the HP->LP mapping process - which again is all about normals - the final result is much less predictable.

              Comment


                #8
                Originally posted by mslaf View Post
                You can create additional splits, bake normal maps and remove them before exporting. Consider this, as a more convenient alternative to baking normal maps and then removing gradients in photoshop. You got the same result + some time for a beer or two
                Thank you so much mslaf! This is a good trick! I didn't realize that you can bake with a diferent LP than which you will use in UDK...
                It works better than the smoothing groups.

                Another trick I've found in the epic examples, is that they don't use normal maps for the corners, only a single smoothing group and the normal map is only for the reliefs but not for the corners.. The smoothing from the single SG seems to be enough for the corners when you have them simply beveled...

                Maybe I was complicating more than I should..

                Comment


                  #9
                  Nah, I had the exact same issues and problems, I'd never done "next-gen" assets before and ran into the same nightmares with smoothing and normal maps, you aren't alone

                  Just to add very slightly, even though you've "beveled" some of the stuff in the original pics, you haven't solved the actual problem, which is stuff like those 90 degree edges at the top of your object. Beveling doesn't do anything magical as an operation per se, but when used on that 90 degree angle, obviously cuts the hard angle down, and allows for smoothing to work properly. Smoothing fails on those 90 degree edges, beveling lets smoothing work better, simple as that, but it sounds like you figured it out.

                  Mslaf's explanation of the gradient stuff is fantasic, so yah, what he says And yes, as you've figured out, you can use a modified model to actually bake the normal map, and have it be different than your actual in-game model (so adding in those extra edges, etc). For instance since I try to mirror stuff, my actual baking model will usually be a 1/2 version without the extra side's UVs overlapping since it sometimes causes bake errors depending on what you're using.

                  Comment


                    #10
                    Thank you danimal for the added information.
                    Regarding what you are saying and for illustrating the epic technique, I upload some captures. They mirror and overlap, with straight UVs for matching to the straight texture of the normal map, done in Photoshop..
                    They bevel the corners with 3 edges for a better smoothing without the needing of any baked normalmap for the corners.

                    I believe this technique is the best, the less complicated and the most economic because you don't need normalmap textures for the corners of each Static Mesh..



                    Comment

                    Working...
                    X