Quote:Original post by FReY
Most people use a normalization cube map to sort this out. Treat your light-direction vector as a 3d texcoord and lookup it's length in a cubemap that effectively normalizes the direction vector. This is done in the pixel shader so that it normalizes the interpolated light direction vector before dotting it with normal obtained from your normal-map.
I'd like to point out this is becoming less and less common, instead the normal way of doing it now is to use normal instructions as on newer cards (any recent ATI and probably NV40 and up from NV) this will be faster and doesnt use up any memory bandwidth, which is alot more presious to concerve (see GDC05 presentations linked to in the Forum FAQ, I'm pretty sure its mentioned in the GLSL one)