Problem with normal maps

Hi there!
I’m new to JME3, hovewer I’ve read all the topics about normal maps, tangent generation and shading. Almost all.

Here’s my problem:

On the left side is a hi-poly mesh, in the middle - low poly without normal map. The last one has a normal map.
As you can guess the problem is strange lighting on some parts of my mesh.
I tried to figure it out, without success, but here are my conclusions:

  1. Normals of the faces are OK (checked in blender).
  2. I inverted the red and green channels of Normal Map
  3. I tried option:
    [java]TangentBinormalGenerator.generate(geoz.getMesh(), true); [/java]
    I mean this second argument - true, as I’ve read that it fixes the Generator.
  4. I’ve tried Ogre exporting, however, ogre’s mesh.xml doesnt contain tangents, only .mesh, but I dont know how to use it.
  5. I’ve used mesh.xml and blend formats, with and without materials.

Nothing helpes.

Here it looks in Blender (with blender’s normals - i mean without inverting RG channels):

I’ve tried to edit above post, but I dont see such button. I want to make it clear: the problem is that some faces on low poly normal mapped mesh look like they were inverted, but they’re not. Especially on the face. There’s also one on the ribs. The whole mesh looks ugly.

Hello,

You did all right.

But you also need to invert green or red channels of normalmap.
Just open your normalmap in gimp/PS and invert red or green channel with Curve Tool.
I just don’t remember which channel should be inverted.
Or possibly you need to invert both.

2 Likes

Hey man!!! Thank you very much.
I havent thought of inverting only green channel - this was the problem. I tried inverting both R and G, and only R, but the solution was to invert green.
Thanks again.

However, there’s a nicer way to invert than using PS/Gimp/Blender nodes.
In Blender image editor, go to Image-Invert or in JME Texture Edit tool (ppm on texture - edit) - there’s Filters menu which contains Invert submenu.

@ubuntuser said:

However, there’s a nicer way to invert than using PS/Gimp/Blender nodes.
In Blender image editor, go to Image-Invert or in JME Texture Edit tool (ppm on texture - edit) - there’s Filters menu which contains Invert submenu.

The best way to invert is in shader. But the Lighting material does not support it.

1 Like