[SOLVED] Normal map causing undesired lines [image heavy][solved]

Hi, I’ve started trying to use normal maps for the first time since my models looked plain without them.

The code to load it is pretty simple, I hope I am doing the tangent generation bit right?

player = new Node();
Spatial p = game.getAssetManager().loadModel("Models/Actors/Players/newfemale.mesh.xml");
Material mat = game.getAssetManager().loadMaterial("Materials/Actors/Players/newfemale.j3m");
mat.setColor("Diffuse", new ColorRGBA(1,1,1,1));

Without a normal map my model looked like this:

When I add normal maps, a problem occurs:

Most of it I really like, but the face is totally messed up. I do not understand were that line comes from going down the forehead, throat, and back of the head.

Here is the UV Map:

And here it is again with the UV overlapped:

The face is on the right hand side (its all plain, no detail).

I figured the problem was the normal map bleeding since the forehead is quite close to another part

To test this I scaled down this part of the UV giving it plenty of space

(the model only has 1 UV map so it is the same on the normal map)

This did not work though, the problem still exists

I have read about how JME uses normal maps, so I have tried inverting the green channel of the UV image but nothing changed. I did not make these normals in Blender so am not 100% sure they are correct for JME, but the majority of the model seems to be working, just not the face.

I have also tried using an entirely plain normal map.

Which works over the entire model but again not the face

The part were the problem occurs is were a mirror modifier was used, but the same is true of the entire model and the problem does not extend down the torso.

I know its hard to see, but I have also checked the normals on the faces and made sure there are no duplicate vertices - it is properly joined and the normal look correct.

I’m not sure what it could be, or even how to find out?

I have never seen someone unwrapping a face like that.
Usually you have both halves in the texture and in the normal map.
Are you sure that you need only one half of the face?<

What you might do in Blender: use a margin > 0.
In that case the normals will be painted around the face.

I hope you know what I mean by 1. and 2. ? :chimpanzee_smile:

I know what you mean in 1. This face was botched together from photos and is symmetrical so I’m cool with half a face.

For 2, I don’t know. The margin when baking or unwrapping? Not sure what you mean about the normals being painted. (I don’t know if its relevant to that but I did not make this normal map with blender)

I’m gonna try re-unwrapping the face quickly again to see if not using half solves it

EDIT: That did get rid of the line…

But now I don’t understand why having UVs that are mirrored so on top of each other don’t work in this case? It seems to work for other parts of the body, just not the face

EDIT2: solved. Thanks Ggil you got me on the right track. I didn’t find this massive topic when searching ([BUG] Symmetrical Blender Model with TangentGenerator and NormalMap - #57 by nehon) but the generator does not work well with mirrored UV it would seem. I didn’t know the ogre exporter includes tangents so it was an unnecessary step, and the ogre exporter seems to work with mirrored UV, so problem solved. thanks

Well, the problem is that there is no information about the neighbor vertices+normals at that point.
So it’s easy to write software that can’t handle this situation.
I think the Blender exporter needs an update then.
If I got that right, jME team is trying to leave Ogre exporter behind.
But that might be difficult when the alternatives are not ready and bug-free yet…

Last I looked, there were no official versions of the Ogre exporter being maintained for newer Blender versions… I don’t think it’s us that’s leaving it behind. Maybe the situation has changed.

There is a desire to have something better than that relatively fragile exporter for a different engine, though. Really looking forward to xbuf maturity.

Yeah xbuf looks cool. Personally I’ve had nothing but success with the ogre exporter so far

There is a splitMirrored parameter to duplicate mirrored vertices… or a checkbox when you do it in the SDK

Mhh that must be a recent addition… last time I checked it wasn’t.