Normal Map shading problems

What with the old tangent generator?

Old generation does not have this “specular stroke” issue

But it is still old, broken generation :smile:

btw, why MikkTSpace dont have “split vertices with mirrored UV”, can it be a problem in this case?

Idk, I’d have to see your UV layout to tell if there are mirrored uvs :wink:

What you can do though is call first the old generator with the split mirrorred to true, then call the Mikktspace generator afterward.

ok so no mirrored Uvs. So splitting won’t help.
For the record, the mikktspace I implemented is the regular blender implementation. So I really have no clue why it’s not working with that generator…

I’ll think about it, I have to catch some sleep first…

Next try, PBR:
Standart tangent generator:


The problem was found via PBR exploring:

@nehon: I think i fixed the shading problem and made a pull request for the PBR branch.

also the ripples effect is caused by banding because of the 8 bit normal map, a 16 bit map would fix this, but the best trick to avoid banding is to bake the normal map with 16 bit channels and then convert it in Photoshop (or GIMP, Krita whatever) down to 8 bit which will introduce dithering, the dithered texture is a good compromise in quality to texture size.
Polycount has a discussion about it with nice pictures:


I can’t give you enough like for this dude… thanks a lot.
I merged the PR

Thanks! I am always using 16 bits png as my output and than I convert it to 8 bit tga in photoshop.

But the problem of shading is still in place, alas :frowning:

Model still has this specular artefacts.

Maybe I am doing something wrong. If so, here is my model:

Maybe that’s the parallax fix… does it changes when you change the lightProbe radius?

Nothing changed at all.

final BoundingSphere bounds = (BoundingSphere) lightProbe.getBounds();

final BoundingSphere bounds = (BoundingSphere) lightProbe.getBounds();

Do you have a reference image so I can compare?

Reference image? Of what kind?

I mean the same render with substance painter or sketchfab. With the same env map and same conditions.

Tryed to create as same as possible shots


Look closer at the white stripe on the enviroment map, in substance it make strong reflection over the back of mesh, and in JME it is rarelly visible

Also, I did turn on directional light

Look how it creates specular on red ring and how should create in flat beveled edge, I suppose it is normal map and tangent problems.

p.s. I tryed to correct exposition as in substence, but it is pretty hard :smile:

So I’ve made some tests
I merged Perjin’s fix with the classic lighting shader and I used a classic cube like in this post:

Here is the result : left is the old tangent generator, right is the mikktspace generator.

Not much better. There are still dark areas on the faces.
Note though… that there is no visible difference between the generators…

I looked on the interwebz on how substance painter computes its tangent space. They apparently use mikktSpace, but since few version there is a new option when you create a project:

“Compute tangent space per fragment”
I searched and it seems that if you want to export to Unity you need that unchecked, but if you export to UE4 you need that checked… so I tried as if we were UE4… :smiley:

I checked that box and re-baked the normal map from the high res mesh then used it in my scene

That is by far the best result I had so far…

This is standard lighting so there may be other issues with PBR and reflection, but I want to tackle this…
I’m going to try with your gun model an see if it’s better (with lighting first). Then we’ll see for PBR.


Hm, interesting!
It looks more accurate! Hm. Still we have this problems, but overall shading more precise than before

Chromemat test:
Old normalmaps

Your method of generation:

I guess I need to try different baking softwares to see if theygive some different (accurate) results


Ho cool the reflection looks a lot better…

As far as i can tell there are no errors for me in my normal maps (with mikk tangent space).
Blender bakes correct by default.
For xNormal you have to activate “compute binormals in pixel shader”:

click the Tangent basis calculators tab,
then “select Mikk - TSpace”
click “Configure”

With this checkbox checked normal maps became even worse:

Standart generation with MIKKTSPACE tangent generator works as subtance without “compute space per fragment”

correct curved skydome in the planet of Saraksh from the “Prisoners of power”