Sunday, April 18, 2010

XNA-ShaderEffect(Step.3)



Norma Map:

  float3x3 tgtSpace;
  tgtSpace[0] = mul(input.Tangent,skinTransform);
  tgtSpace[1] = mul(cross(input.Tangent,input.Normal),skinTransform);
  tgtSpace[2] = mul(input.Normal,skinTransform);

  float3 tgtLightDir1 = mul(lightDir1,tgtSpace); ***
  float3 tgtLightDir2 = mul(lightDir2,tgtSpace); ***


-----------------------------------------------------------------------------------
PixelShader

return    outColor * (diffuse*2) +Specular Light;

No comments:

Post a Comment