Home Technical Talk

Baking normals with artifacts in Blender

Hi, I'm having problems baking normal maps in Blender. I'm not figuring out what is it that I'm doing wrong but I'm baking from selected to active but the resulting normal map has these shading artifacts that resemble low-poly smooth shading (triangular artifacts that coincide with low poly triangulation). I tried applying all modifiers to the hi poly and triangulating the low poly but saw no change. I wonder if any other blender user has found this problem before or has any Idea as to what am I doing wrong



Replies

  • pior
    Options
    Online / Send Message
    pior grand marshal polycounter

    Upload your meshes.

  • okidoki
    Options
    Offline / Send Message
    okidoki polycounter lvl 2

    Seems to be a normal orientation problem already in the lowpoly . Did you checked with Overlays --> Face Orientation (no mix of blue and red).. ohh wait -- you have n-gons in lowpoly.. not so good..

  • Andermaiden
    Options
    Offline / Send Message

    all faces seem to face the right way and triangulating the low poly mesh to get rid of the n-gons doesn't seem to solve the problem either

  • Andermaiden
  • okidoki
    Options
    Offline / Send Message
    okidoki polycounter lvl 2

    Okay then maybe your n-gons wheren't planar? Luckily blender has select similar: normal or coplanar. (Strange thought: I wonder if different flat or smooth face shading influence normal baking.. never came across this.. does you have different face shading?)

  • Andermaiden
    Options
    Offline / Send Message

    The low poly mesh is shaded smooth without autosmooth so all faces should have the same value. By the way I tried flattening all the vertices of the top faces just to make sure they are coplanar (not that anything changed visibly so I imagine they were already) but the problem persists.

    Can't find anything odd in the direction of the normals, at least by looking

  • FrankPolygon
    Options
    Offline / Send Message
    FrankPolygon grand marshal polycounter

    These baking artifacts are caused by the convergence of a number of separate but related issues.

    Material artifacts: The material on the high poly model is generating additional surface information that's causing normal baking artifacts. Removing the material from the high poly model resolves this issue.

    The material on the low poly model needs a normal map node, set to tangent space, between the texture output and the normal channel input on the material shader node. This will allow the low poly shader to display the baked normal information correctly.

    Low poly model artifacts: Untriangulated meshes can cause shading issues if they are reordered after baking. It's generally considered best practice to triangulate the mesh before baking. That way the mesh triangulation order remains consistent.

    There's also a lot of long thing triangles in the low poly model. This can cause visible lines in lower resolution bakes. Cutting in some supporting geometry between the shapes can help even out the size of the triangles and prevent this type of baking artifact from appearing.

    Shading the entire mesh smooth is convenient but it can cause strong gradation around areas where there's an abrupt change in the angle of the adjacent surfaces. Additional geometry or hard edges can be used to control the shading behavior of the low poly and reduce the severity of any gradation in the baked normal textures.

    UV islands that are pinned around a single connecting vertex or are close to overlapping can cause intermittent edge artifacts. This can be resolved by either merging or splitting the islands that are close together and ensuring there's enough padding around the rest of the UV islands.

    High poly model artifacts: Pinching and near overlapping faces can cause several different types of baking artifacts. While it's tempting to try and brute force the sharp edges of hard surface shapes with creasing and extra subdivision levels, it's generally going to be more effective to use support loops that provide a soft, consistent transition between the surfaces.

    Any significant mismatch between the surface of the high poly and low poly model(s) can cause waviness and skewing in the baked normals. This is especially noticeable along curved surfaces and around shape transitions. So, it's generally considered best practice think about how the model will be viewed from the player's perspective and use an appropriate amount of geometry to create a low poly model that accurately follows the shape of the high poly model.

    Some additional resources that may be helpful with resolving these baking issues and optimizing the low poly model:

    https://marmoset.co/posts/toolbag-baking-tutorial/

    https://polycount.com/discussion/comment/2760744/#Comment_2760744

    https://polycount.com/discussion/107196/making-sense-of-hard-edges-uvs-normal-maps-and-vertex-counts#latest

    https://polycount.com/discussion/81154/understanding-averaged-normals-and-ray-projection-who-put-waviness-in-my-normal-map/p1

    https://polycount.com/discussion/147227/skew-you-buddy-making-sense-of-skewed-normal-map-details/p1

    https://polycount.com/discussion/148303/of-bit-depths-banding-and-normal-maps/p1

  • pior
    Options
    Online / Send Message
    pior grand marshal polycounter

    Hello,

    This is what you uploaded :

    While the high is clean (and looks excellent really), the low is just not acceptable at this stage. There is no point worrying about baking before this is adressed.

    Set your hard edges as needed, triangulate as needed, double check your UVs, and so on. Only once all that is done will you be in a position to worry about baking.

    These issues are completely unrelated to Blender BTW.

  • Andreays
    Options
    Offline / Send Message

    For me this was caused by my material (from Blenderkit) having a displacement texture / input. Removing the displacement input fixed the artifacts.

  • Andermaiden
    Options
    Offline / Send Message

    Oh my, I thought that low poly meshes were just placeholders for baked textures but from what I gather now low poly topology and shading does influence a lot in the baking process besides the UV's. To confirm this I baked a normal with the low poly mesh set to shade flat and it completly changes the result

    (obviously it introduces hard edges wich is not the solution but it produces clean normals in flat faces). Now I think I have to re learn a lot and remake my low poly workflow. Thanks to everybody for your contributions, specially to FrankPolygon for the additional information!

  • pior
    Options
    Online / Send Message
    pior grand marshal polycounter

    @Andermaiden : In a way you were only partially incorrect (or partially correct depending on the way you look at it :D )

    • Lowpoly meshes can indeed be used as placeholders for transferring data. That's a pretty advanced technique though (using a lowpoly as a proxy by baking normals data down to it in Object Space, bypassing any surface shading information), and then transferring that back to yet another model. But as said this is a rather advanced technique that not many people use or even know about, partly because not every baking environment supports it and partly because it requires some solid understanding on how all this works in the first place.

    • But for final assets actually used in production, a lot of care needs to go into getting the lowpoly just right. That doesn't mean that it needs to be a tedious task or that it adds extra time though - it just means that similarly to how you know how to lay down creased edges in your highpoly models to get nice shading once subdivided, you need to learn how to carefully juggle hard edges, triangulation and custom shading in your low to get solid results when baking. Once you understand these various factors, taking them into account while modeling becomes second nature. To give you an idea someone with good knowledge and experience would be able to get this gun part perfectly ready for baking in less than 15mins. As said : by manually placing hard edges where needed, triangulating everything, and perhaps doing a few test bakes to see if face-weighted normals would be useful or not.

    Overall you need to keep in mind that at the end of the day it's the lowpoly model that actually ends up in game. The high only provides a tiny bit of shallow surface data converted to a bunch of pixels. (An ideal workflow would consist of working on both models at the same time in parallel, but unfortunately this is not always possible.)

  • Andermaiden
    Options
    Offline / Send Message

    Hi everyone, I wanted to make a follow up post to show you how helpful your advice was. I've workd on the low ploy mesh and got rid of most of it's shading artifact, so much so that now the low poly shading resembles the high poly one. The new baked normal map is considerably better, even though there are still details to tackle.

    Something I couldn't fix though, is that in some seams there's a drastic change in shading

    In this case one side there's a drastic change in shading but in the opther side it doesn't seem to happen and it's symetrical (same geometry, same seams). If anyone's got a clue, great! Otherwise, thanks again to everybody for the tips that helped a lot! 😀

  • Fabi_G
    Options
    Offline / Send Message
    Fabi_G insane polycounter

    Is the color space of your normal map sampler set to sRGB? If yes that might be the issue (gamma correction), make sure it's non color.

  • Andermaiden
Sign In or Register to comment.