   Problem on Tangent to View Space
  I’m facing a problem with the tangent vectors.I’m using Deferred Shading and for some reasons I need to do all the lighting in View Space. So I need to move the bump normals from tangent space into view space, but they get wrong in the transformation.What I’m doing is getting the Normal, Tangent and Binormal vectors from the vertex input. Then I multiply them by the matWorldView to transform them into ViewSpace.Therefore the matrix  float3x3( T, B, N )  holds the transformation from tangent space into view space. I multiply the bump normal by that matrix and it should make it into the view space. Then JUST FOR TESTING that the normals are right, I place a constant light vector and do a dot product to compute a directional lighting. The problem is that two parallel faces get different illuminations and it appears as is the light came from a different direction for some faces.This is a test fx that shows the problem. You can test it with any .x you have.float4x4 matWorldViewProj : WORLDVIEWPROJECTION;float4x4 matWorldView : WORLDVIEW;float4x4 matView : VIEW;string XFile = "box.x";texture NormalMap <  string name = "Bricks.bmp"; >;sampler sNormalMap = sampler_state{    texture = <NormalMap>;    MIPFILTER = LINEAR;    MINFILTER = LINEAR;    MAGFILTER = LINEAR;    ADDRESSU  = WRAP;    ADDRESSV  = WRAP;    ADDRESSW  = WRAP;};struct VS_INPUT{    float4 Position: POSITION;   float3 Normal  : NORMAL;    float3 Tangent : TANGENT;    float3 Binormal: BINORMAL;   float2 Texcoord : TEXCOORD0;};struct PS_INPUT{    float4 Position   : POSITION;   float3 NormalVs   : TEXCOORD0;    float3 TangentVs : TEXCOORD1;    float3 BinormalVs: TEXCOORD2;   float2 Texcoord   : TEXCOORD3;};PS_INPUT vs_main(VS_INPUT Input){PS_INPUT Output; Output.Position   = mul( Input.Position, matWorldViewProj );    Output.Texcoord   = Input.Texcoord;   Output.NormalVs   = normalize(mul( Input.Normal, matWorldView ));    Output.TangentVs  = normalize(mul( Input.Tangent, matWorldView ));    Output.BinormalVs = normalize(mul( Input.Binormal, matWorldView ));   return Output;}float4 ps_main(PS_INPUT Input) : COLOR{   float3 Bump = tex2D(sNormalMap, Input.Texcoord )*2-1;    float3 Normal = normalize( Input.NormalVs );   float3 T = normalize( Input.TangentVs );    float3 N = normalize( Input.NormalVs );    float3 B = normalize( Input.BinormalVs );    //normalize( cross(T,N) );    float3x3 matTangentToView = float3x3( T, B, N );    Normal = normalize( mul( Bump, matTangentToView ) );    float3 L = normalize( mul(float3(1,1,-1), matView) ); // Light direction specified in world space and then transformed into view space    float d = dot(L,Normal);    return d;}technique Single{    pass p0{  VertexShader = compile vs_2_0 vs_main();   PixelShader  = compile ps_2_0 ps_main();//   CullMode = CW;    }}Any suggestions will be welcome, since I’m out of ideas and short of time.Here is a screenshot showing the problem:
  Have you tried doing it in world space to see if there is a difference? Also, maybe your tangents are just incorrect...   