View Full Version : Is this normal mapping done right?

06-28-2015, 11:47 AM
Hi, I have these textures
and I've done a normal mapping with this result

I'd like to ask if it is done right.
Thank you for your opinion.

06-28-2015, 01:27 PM
I'd like to ask if it is done right
Maybe. Is the light coming from below and left?

You really need to see how the lighting changes as the light moves.

Also, to tell if you're doing tangent-space mapping correctly, you need to use a surface which isn't flat.

One other point:

n = gl_NormalMatrix * gl_Normal;
t = gl_NormalMatrix * gl_MultiTexCoord1.xyz;
b = gl_MultiTexCoord2.xyz;

This will result in b being perpendicular to n and t, but t won't necessarily be perpendicular to n (i.e. it won't necessarily lie in the tangent plane). Typically, you'd transform n by the normal matrix and b and t by the model-view matrix so that n is perpendicular to both b and t. But this only matters if the the model-view matrix contains non-uniform scaling or shear.