Baked Normal Map Issue

Hey,
So I’ve recently discovered a problem in Unity involving baked normal maps, particularly when it comes to flat surfaces.

Here is a brick model in Blender with the low-poly with a baked normal map on the left and high-poly on the right: Screenshot - f0ccebf10250f4275797a213e529b14e - Gyazo

As you can see the normals on the low poly are correct. However when i import these models into Unity it looks like this: Screenshot - 413f5c117420f279a2ade6a0f48ad1da - Gyazo

Theres also issues on the corners as well that are present in Unity but not Blender:
Blender: Screenshot - 80d1312e48f321fbec708cbc3b3e5ca3 - Gyazo
Unity: Screenshot - c70f227cf715c00c0fffcc429b98ebb1 - Gyazo

There’s some weird shading going on on the flat parts of the low poly, even though the models and textures are exactly the same. I’m not sure what’s going on since Blender’s render is fine but Unity’s isn’t…

UPDATE:
I was able to solve this by checking the “Tangent Space” export option in blender and then set my model in Unity to import tangents instead of calculating them.

I may have spoke too soon… It looks like almost every face on the cube I was using to test is fine: Screenshot - 560dc99a67d1bc34660b9e0577afea61 - Gyazo
Except for ONE face: Screenshot - 58c0c3683cf05bdb327bfe91c0ff0492 - Gyazo
Now i am just really confused.

Also I found out that I have to use XNormal to bake or else all the faces will look weird like they did before.

There’s no universal scheme for normal maps. I believe I’ve encountered this problem before and it has something to do with blender using a different-handed coordinate system than Unity which results in normal maps being baked incorrectly for Unity’s scheme. I believe I had to write a program to flip one of the axes on my normal maps from blender - I can’t recall.

EDIT: here: http://answers.unity3d.com/questions/28850/tangent-normal-map-produces-reversed-effects.html

1 Like

That doesn’t seem to work for me. I don’t know if I am skipping some steps here but I’m not getting good results at all: Screenshot - 003110cf2b5399ede9a21b3e65739b7a - Gyazo

I baked the normal map in blender normally, then inverted the red and green channels in gimp cause I’m not really familiar with Blender’s image compositing (plus that section on the Blender wiki is really bad and outdated).

This is the normal map blender generates: Screenshot - 61fa193ec6f869a7177797df302ea242 - Gyazo
And this is the result of inverting the red and green channels in gimp: Screenshot - a6c80335469ba76ccf1208f38cdd2076 - Gyazo

I’ll stick some more reference pictures here so you can see the results i’m getting from other methods:

Blender unmodified normal map: Screenshot - 265800d99b358b7a87e7e219347bf494 - Gyazo
Xnormal map: Screenshot - e3e1940c0339d352ab30d6a88724f8e0 - Gyazo (Some faces such as the right face look OK while other faces have issues like the left face).

This model was exported with the tangent space option checked and is using imported tangents in Unity.

Hmmm… well, I just baked some normals in Blender 2.72 and they seem to be working fine (unmodified) in Unity 5.02:

Your problem with importing cubes into Unity might be that you have them set for sharp edges in Blender which won’t import into Unity without using the “edge split” modifier. Unity will take the mesh as you assigned it, with only one vertex per corner resulting in a normal vector that points diagonally from each corner away from the center of the cube. What you need to do is separate every face of cube before you export it so that there are three vertices per corner, not one.

I’ve just been using smooth shading for my cube so it looks like this in Blender: Screenshot - 8da62c29ed5eda4b1d600d11fac47ab8 - Gyazo

If i make the edges sharp (so it looks like this in Blender: Screenshot - 00e55536e7e352ff7756890043b58377 - Gyazo) an rebake it does fix the shading on the flat areas but then the corners have bad-looking seams: Screenshot - 74758022dcefec360921956a7ca2a557 - Gyazo