Download

Baking Normals for UE4

Hey all,

I am just going through some normal mapping problems which is quite minor (I guess?) but I just cant stop thinking about it. So here goes…

I baked a simple mesh with high poly and low poly, where the edges are chamfered, including the low poly. I used 3ds Max to create the mesh and bake the normal maps.
The low poly has only 1 smoothing group, to have smooth rounded corners.
Then I imported the mesh and normal maps to Marmoset Toolbag 2, applied a chromium material, and at first it looks a little wrong at the UV breaks.

screenshot000.jpg

Then I inverted the Y. Which means it needs to be inverted.

58b8dd3b203193d01bca123df416b358056345ea.jpeg

All looks great! Even though if you look closely, there is still a line. Its ok.

Then I tried to import it into UE4, then this happens.

e535f42836100829643cf52ceead7da1fcd21269.jpeg

But then I tried to invert the Y as well, by both rebaking or trying to add (1,-1,1) to the normal in material. And ended up with this:

20b4f87bc32ac2dff56f318af1e85c6f6d59c98e.jpeg

The line is still there!! Does anyone know why!? Am I missing something? I hope someone can clear this up for me. It is bugging me ever since I started using UE4. Thank you!

Can you make material with normals connected to diffuse (or emmisive), apply it to that mesh and post picture?

Hey Nawrot, Here is the picture.

HighresScreenshot00002.jpg

And here is just a snapshot of my material for the object.

d998ebfb3c157dce2d20f342af9c2b3aa9948412.jpeg

Here is my normal map.

795b79c8cb5a7a79132fa026d4311c2690e45676.jpeg

Roughness 1 metalic 0 i just want to see normals on your mesh no reflections. I think you do not have continuous normals on that edge, but cannot see if from all that shiny stuff.

Make unlit material connect normals to emmisive only. like normal map was just color, nothing else.

I see some seams on your normal map, if its smooth surface with same smoothing group, normals should also have smooth gradient.

Not sure but you may need to just chamfer edges so there is no sharper edge than 45 deg, but it may be also just bad normalmap.

And here is with the normal into Albedo ONLY, nothing else. No metal/roughness etc.

bf4569de877ac519110a2a48c1750e094f66305a.jpeg

You see that blue to pink seam? This is the culprit. Ithink you need to uv unwarp that mesh in better way.

Its quite low poly, but bent. So make unbent hi and lo poly meshes. Uv unwarp them so they do not have seams on long edges, bake normals. Make copy of low poly and bend it.

Also this is great baking tutorial, i learned it all from this tut:
http://3dhowiseeit.blogspot.com/2010/04/treasure-chest-how-to-bake-correctly.html

ps. Substance designer and Painter are best tools to bake all kinds of textures now. And they have cheap indie bundle.

You need to import your normal map with normal map compression. If you have the word Normal in the file name it will automatically ask if you want it to be imported as a normal map.
If it’s imported correctly, the normal map will appear more blue because of how it gets interpreted.

Yeah I do realise that it’s the UV problem, but so if I stitch the poly on long edges, I am certain it will disappear. But the thing about UV mapping is that it has to appear somewhere, preferably at places we can’t see or short edges. But still, in that case we can see them.

But do you know whether UE4 has Y+/- for normal maps? And why does it appear right in marmoset?

I have not tried the unbending and bending thing you told me, I will get back to you and see if it works! Thank you.

Unbending is only for easier uv mapping, which means no seam on bend edge. Your normal map is baked incorrectly, there should be no pink to blue seam, if smoothgroup is same and no sharp edges you should get there smooth gradient.

Hey, I have tried to rebake the mesh in Substance Designer like you said, and I came up with this…

1f7c778a32aa051df166f60894ce652f524d4d10.jpeg
e15145d15ee99285561b5b8f04c019817d0c14b7.jpeg

I did not change the UV break, just to test whether it made any difference baking in substance designer. And I guess it did? But the smooth surface has grids for some reason… Even though with the normal map to albedo picture shows that the normal map doesn’t blend seamlessly, it produces better results! However, I am thinking, maybe someone can take a look at my max file (2012) and see where i went wrong? Thank you. Here is my file: link

neither your mesh nor your UVs will yield you the results you desire.

14fcd7877a586e7d74c29b513d213af78d48d3fe.png
86d8e1f54c4079b28402afdcf9f89d4b1bf5fe72.png

with this mesh (smoothing groups and UVs are sharing the same edges) and a normal map with red right and green down i get this result.
I unwrapped the straight mesh - and did the chamfer after the bend with a modifier, but only because i am lazy. won’t be any different if you do the chamfer by hand.
the UVs have padding at the edges which is not visibile on this screenshot due to downsampling.

Screenshot 2014-12-23 10.34.00.png

p.s. having the normal map show a seam in the tangent space like in your screenshot is perfectly normal and desired - it is a tangent space normal map after all… your issues are solely due to where you split your UVs/smoothing groups which forces the normal map to compensate for a strong angle change with very limited texture space.

Screenshot 2014-12-23 11.01.44.png

always triangulate low poly mesh before baking and remember to export normals to baking app like xnormal, also check option to import normals when importing into unreal

It worked! But…

Thanks divi!

I got it working, so I did what you did, I remade the mesh with the modifiers set up like this:
7a296042da80396568add45488562c6954edfb35.jpeg

My mesh is therefore chamfered and bent AFTER the UVW unwrap. I always thought that UVW unwrap should be at the last step before setting up cage, I didn’t know we could still edit the geometry AFTER UVW unwrap! Great.
ecc79d574e340b5629a54f8736c8e6f9da4f129a.jpeg

Here is the final rendered image in UE4! It looks great, and I’m sure the seam lines will always be visible if we look closely enough. But we can’t do anything about that right?
693994c31701e83cd0cf6ee7140c92d2478c3374.jpeg
16de9f43be53f0d9b39249cfe2af32f1b7e9beeb.jpeg

Thank you for everyone for the help! However, I do have one last question. Does anyone know why does the reflection looks blurry? as if it has a grainy surface. Is it because of the normal map? Below I have removed the normal map from the material and it looks smoother.
smooth.jpg

Edit: sorry for the bump, this post was linked elsewhere

There’s tons of miss information in this thread.

You do not need to bevel or chamfer to avoid seams, you can get seamless results on a cube.

Always bake in a program that supports Mikk Tspace. xNormal is a cheap and free option.

Make sure you are using a synced work flow, here’s a great post explaining how http://www.polycount.com/forum/showpost.php?p=2257792&postcount=1845

The noise you are getting is normal and from compression, what you can do is bake a 16 bit normal map before down sampling to 8 bit. Basically there’s not enough color information in a standard 8 bit image to make a very glossy look smooth, a bit of roughness easily covers that up, otherwise you can either avoid using a normal map or plan with compression, or try to model and bake around avoiding gradients in your normal map.