Normal map artifact still here.

Started by
17 comments, last by Mihumihu 9 years, 6 months ago

Switch to a single directional light without the specular, rather than a point light with.

The artifacts should at least be gone in that case because then the lighting value of each pixel is based exclusively on the normal in your texture.

If they're still there, there's something else wrong.

Once you confirm they're gone...

Then it's probably because of those physical crinkles in your mesh.

Write the world space of the vertexes into a texture too, and interpolate those as well like you did for the normals.

That may trick your pixels into thinking they're somewhere they're not, and should give you smooth results when you calculate the angles.

Your texture format is RGBA 8-bit per channel? That may introduce artifacts with normals, because it isn't very accurate format.

Cheers!

Wouldn't that cause very subtle banding instead?

Advertisement


Wouldn't that cause very subtle banding instead?

Well, with a limited amount of normal directions, it will cause some artifacts (I wouldn't call it banding when talking about normals). I'd try at least 10-bit per channel format or even 16-bit floats.

Cheers!

One byte per component of normal direction is just enough- I would examine your object space normals texture accuracy instead (try some other production software with the object space normals texture you have spawned). You realy should have smooth diffuse dot product with object space normals over the shader you have presented.

And one last thing - provide the second picture in your OP post with magnification NEAREST and minification NEAREST (no filtering). It can happen that your object space normals texure resulution is way too small to spectate such an atomic space on the mesh (in other words, triangle covers few pixels of texture). This is very unlikely though! But this issue is interesting. From my own experience, I can spectate a nose peak of a character without any edges, when object space normals are used (not tangenting ones of course)


One byte per component of normal direction is just enough

It isn't if you are fighting artifacts - unless you use some wise packing scheme and in the presented code there isn't any. I'm not saying that it is the issue here, but it is something to consider and very easy to test. The problem typically shows especially with specular hilites.

Cheers!

And one last thing - provide the second picture in your OP post with magnification NEAREST and minification NEAREST (no filtering). It can happen that your object space normals texure resulution is way too small to spectate such an atomic space on the mesh (in other words, triangle covers few pixels of texture). This is very unlikely though! But this issue is interesting. From my own experience, I can spectate a nose peak of a character without any edges, when object space normals are used (not tangenting ones of course)

101153_1414825675_normals.jpg

normals2.jpg

I think this is as you said before interpolation thing...

First test your object space normal texture for accuracy, by doing what Kauna says, apply only directional light onto your diffuse component.

And following can be source of problem (though unlikely).

normal = normalize(v_NMatrix*normalize(nc.xyz));

the v_NMatrix is a varrying attribute, though you assign an uniform matrix to it in the vertex function. Use the uniformal matrix in pixel shader, no need to pass it as an input since it is a uniform. But it much likely won't solve the problem since the varying matrix is the same for all three verticies.

Good day to do something!

And I've found nice article:

http://www.geeks3d.com/20130122/normal-mapping-without-precomputed-tangent-space-vectors/

This topic is closed to new replies.

Advertisement