Isn’t something with the comment found in lighting.frag?
//Note the -2.0 and -1.0. **We invert the green channel of the normal map,**
//as it's complient with normal maps generated with blender.
//see http://hub.jmonkeyengine.org/forum/topic/parallax-mapping-fundamental-bug/#post-256898
//for more explanation.
Thanks guys but it’s not that issue. I tried both and It looks similar but it’s not that.
I made some progress… but I’m a bit confused. I created a C code that use the mikktspace.c as is, and I managed to generate the tangents in C.
The first thing I noticed is that the tangents values are VERY close to the ones generated by JME’s TangentBinormalGenerator.
Here are some screenshot :
Standard generator
MikkTSpace tangents:
As you can see the result is slightly better… but still obviously wrong…
There might be another issue…
EDIT : The standard Generator warns about the angle between some tangents that exceed seom threshold (defulat is 45 degres). Maybe I should duplicate those vertices.
I’ll commit my change to master, there are 3 stand alone files, so you 'll be able to pick then and use them in a 3.0 project.
Though note that it won’t solve all issues as it is now. I’m still looking into it.
What do you mean by “a fixed one”? If you made some fixes on the generator I’d be glad to see them.
oh alright. Yeah this bug was introduced by the previous change actually.
ok, so that will be pretty much the same process with the MikkTSpaceGenerator
By the way.
I’ve checked in blender, and Blender MikkTSpace seems to work exactly like your implementation
So this artefacts are “lesser of two evils”, and I believe this black strokes appear because hirez triangulation, look closer, I pointed with arrows.
Also, I recommend to use normal maps from Blender Internal, they seem to be more correct and clean. From far there is no real visual difference between BI and Hirez
Cool thanks.
I want to try something else though… for now we approximate the bitangent (aka binormal) with a cross product of the normal and the computed tangent. But sometimes the real bitangent is not perpendicular to the tangent (though always perpendicular to the normal. usually this approx is ok, but I want to try tu use the bitangent computed by the mikktspace.
I’ll have to modify the shader though.
Some parts of the normal map have high frequency noise / ridges. Are those actually mapped in the mesh? If so, it could cause the artifacts you’re seeing.
Yep but there are subtle inconsistancies in the lighting in JME compared to other softwares that are hard to see on still pictures.
See this cube for example :
See the darker area in the center of each face? Neihter blender nor substance display them.
it’s easier to see the issue with a full reflective material and PBR.
See the distorsion at the center of the face. (don’t mind the pixelated reflection which is yet another issue…).
Substance displays a clean mirror like reflection with the same model and same normal map.
That’s wrong tangents.
Ah yes. I’ve seen those small “ripples” with the jME WaterFilter when looking from underwater into sky (even though ripples were turned off). Might be related to that.
Is the normal map shader evaluated to not be the source of the problem?
Could texture min/mag filters be a problem? Or anisotropic off and then every normal looses its tiny little mind?
Although in this case, I’d expect interpolation to be constant since the normals and tangents should be uniform over the surface. Maybe a view space versus light space issue?
I really think it’s a case of non hortogonal tangent and bitangent…
Idk I’ll continue to look into it anyway.
The thing is… with a classic model with textures and all… you will never notice those issues… It’s just for the sake of having correct tangents.