Getting weird artifacts in UE4 when baking hipoly mesh to normal map in Blender

I’ve looked for a solution on the forums and online but haven’t found anything about this particular problem.

I created a model (low poly and high poly versions) in Wings3D. I imported these in Blender (through Wavefront .obj) to bake the normal and AO maps, and imported them in UE4 (through .fbx of course). In UE4, I get weird normal artifacts.

Here is the lowpoly mesh in UE4 with a plain material (no normalmap):

And here is the mesh with normals applied. There are artifacts on what should be smooth faces near the top and middle:

This is what the lowpoly mesh (://i.imgur/kzd6sZd.png) and hipoly mesh (://i.imgur/72uOx0p.png) look like in Blender. The render produces this normalmap (://i.imgur/z2phuGZ.png) which, when used as an actual normalmap along with lighting, produces this (correct) render: ://i.imgur/APWTcXf.png

Have you already flipped the green channel -> in the texture properties + set the texture type to normal map :slight_smile:

Urgh, firefox ate some of my post. Yes, I flipped the green channel in GIMP (I had also mentioned that the Wings3D model is triangulated so there’s no issue with Blender and UE4 doing it differently).

What do you mean by “texture type”? It seems to have imported as a normal map, since its LOD Group is “WorldNormalMap” and its compression is “TC Normalmap”.

can you add a pic of just the normal map texture?

Here’s the texture: ://i.imgur/AzASzyN.jpg (this is 2048x2048 while the source is 4096x4096, there are also jpg artifacts from imgur - if you need to see the source version I’ll upload that)

have you tried applying flat shading to the large flat surfaces of the high poly model before baking the normal map.

Yes, the second Blender screenshot shows the hipoly mesh with an edgesplit modifier.

When you imported the mesh did you Import Normals and Tangents or did you calculate them? You always need to export tangents from blender, and import both normals and tangents in UE4. This is because the normal map is generated based on the tangent spaces in blender, and if you let unreal calculate its own tangents then you’ll probably end up with different tangent spaces and your mesh will look all wrong. Also, you’ll want to add a triangulate modifier on anything you bake to and/or intend to import for two reasons: UE4 may split the quads differently to blender and this will also mess up your tangents, and the exporter doesn’t support exporting tangents on faces with more than 4 vertices.

So do this:
Add a triangulate modifier to your low poly mesh.
Re-bake the normal map.
Export the low poly mesh with Export Tangents checked.
Import to UE4 with Import Normals and Tangents option.

1 Like

I already mentioned that I triangulated the original mesh.

Wings3D does not have an option to “Export tangents” in either the .fbx or .obj exporters. I’ll look for an .fbx plugin for Blender and see if I can get the mesh to UE4 from there.

[EDIT] That did it, thanks! There’s still a few artifacts but they’re barely noticeable and can most likely be covered up by texturing.

There’s nothing wrong with the highpoly mesh. But there’s only one smoothing group for all polygons in the lowpoly mesh . It gives you to much curvature in the lowpoly surface which is hard for normal map to compensate in the engine. So you get those gradients in the baked normal map which is bad (gives you compression banding artefacts in the engine). I would suggest you try the following:

  1. Select your lowpoly mesh and set Smooth Shading for all the polygons, clear all sharp edges and seams if you have any;
  2. Enter Edit mode > Go to Select > Sharp Edges > Ctrl+E > Mark Seam + Mark Sharp > Exit Edit mode;
  3. Assign Edge Split modifier and uncheck “Edge Angle” so it will sharpen only those edges you marked as sharp. Basically every hard edge needs to have a uv split on it so you get some padding on bake;
  4. Unwrap your lowpoly using the seams you get from previous steps and pack it with enough padding. You’ll get lots of pieces but that’s Ok so don’t worry;
  5. Make a triangulated copy of your low-poly for baking and bake your normal map with padding set to 8 at least;
  6. Export to fbx, make shure to uncheck “Apply modifiers” if you’re using Blender 2.71 or newer (daily builds).

You should get a normal map with almost no gradients for the flat areas which is how it should be. And that’s the way hard-surface baking works, eliminating any chance of errors and artifacts. There’s much more on that in the Polycount forums, I suggest you visit it. Or post here, glad to help =)

PS. Save baked textures to targa (.tga). Unreal imports it correctly and applies TC_Normalmap compression, which it doesn’t if you use png for example. And there’s almost no to none advantage in using 16 bit png, but you’ll have to set compression options yourself instead of Unreal doing it for you if you import tga files.

Cheers, Anton.

Hello everyone. The problem I have is probably exactly the same. I’ve tried a lot of different methods and to what it does not. AntonBoiko your advice too tried and nothing! :frowning: I bake texture in cycles further check in the viewport internal. Exported to fbx with parameters as in the picture.In the picture on top is perfect in a blender and the bottom in UE4. How to get the same result as in the blender?

Here’s a link to the file. ://blender3d.org.ua/forum/beginner/iwe/upload/3244-Normaltest.blend
Please help to solve this problem. I did not even know what to do. Already spent so much time and trouble as was and remains :frowning:

Hi FoxReinar,

I opened your FBX in 3Ds and took just the arm rest and baked out a Normal Map. I ditched the other geometry and only focused on the arm rest. I did increase the UV space for it to get a better bake as well.

Here are the results I’ve got. It’s still a little messy with the bake though just because I rushed a bit.

Here is a link to the asset I tweaked. I didn’t change anything with the geometry.
Ultimately, you may want to redo the topology for the low poly to get better results as this is where the issues appear to be.

an impossible goal

Thanks for the reply ! I looked at your option, and yes the result was better than I was. I translated the mesh triangles exported corrected green channel corrected TC normalmap place for TC default. And here’s the result. Yes already much better but at length from the bottom seen strange shading. It’s like a little texture resolution .4096 * 4096 where much more? Why I do not want much stretch UV so the answer is simple, there are other parts that are also necessary to place. Look at the option that gives the blender. I do think it’s possible to get a result like this in a blender or UNREAL? :slight_smile: Maybe I just want to get something UNREAL simply can not reproduce? Of course you can rebuild the polygons and if not satisfied rebuild again and so on increasing the number .but even so why in the blender without this good result? Just want to understand.

And the thought came. Why not make your system creating Normal maps in the engine?
Most of the questions in the network would be lost because of different standards is an attempt to fit a normal map that uses a standard engine UNREAL. Would not have long to sort out the options.

screenshot

Another screenshot to accurately convey what I would like to see. Just want that picture to be as better.

Baking normal maps can be a incredibly tedious process depending on the geometry, here’s a couple threads on Polycount that should explain some of the problems you can face.
How the normals of the low poly affect the bake using a cage (and why you should use bevelled shapes more) : ://www.polycount/forum/showthread.php?t=81154
How you can prevent these problems with smoothing groups and UV-Splits : ://www.polycount/forum/showthread.php?t=107196

Furthermore, different programs can interpret the normal maps differently which requires a synchronized workflow to create a normal map specifically for your software.
I found Handplane to be the best tool for this problem : ://www.handplane3d/
Handplane will also conveniently fix some smoothing errors you have overlooked. The only requirement is for you to bake the normal map in world space instead of tangent space.
While it doesn’t have a specific UE4 output, UE4 seems to use the same interpretation for normal maps as UDK - so just choose UDK in the conversion options.