Originally Posted By: Kartoffel
@sivan: normalmapping works like this (when using precomputed tangents):

Normal = normalize(In.Normal + (Normal.r * In.Tangent + Normal.g * In.Binormal) * NormalmappingStrength);

...and as you can see, the blue channes isn't needed. wink


That is a valid simplification/approximation when you don't mind its inaccuracy that is quite noticeable on lowpoly models with hard edges.

Geometrically, a correct coordinate system transportation totally needs the multiply of the In.Normal vector by the blue channel. Moreover, you have to normalize the three vectors since the proportional arithmetic averages passed from the vertex shader are not unit vectors.

Normal = (Normal.r * normalize(In.Tangent)) + (Normal.g * normalize(In.Binormal)) + (Normal.b * normalize(In.Normal));

The result of this operation is a vector with same length of Normal vector so there is no need of its normalization.



sorry for the offtopic xP

Last edited by txesmi; 07/17/13 11:27. Reason: explanatory image