Advertisement
Guest User

vertex

a guest
May 14th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "shaders/common/hlslStructs.h"
  2. uniform float4x4 WorldITXf : WorldInverseTranspose;
  3. uniform float4x4 WvpXf : WorldViewProjection;
  4. uniform float4x4 WorldXf : World;
  5. uniform float4x4 ViewIXf : ViewInverse;
  6.  
  7.  
  8. struct VS_OUTPUT {
  9. float3 Position : POSITION;
  10. float4 UV : TEXCOORD0;
  11. float4 Normal : NORMAL;
  12. float4 Tangent : TANGENT0;
  13. float4 Binormal : BINORMAL0;
  14. };
  15.  
  16. VS_OUTPUT std_VS(VertexIn_PNT IN) {
  17. VS_OUTPUT OUT = (VS_OUTPUT)0;
  18. OUT.WorldNormal = mul(IN.Normal,WorldITXf).xyz;
  19. OUT.WorldTangent = mul(IN.Tangent,WorldITXf).xyz;
  20. OUT.WorldBinormal = mul(IN.Binormal,WorldITXf).xyz;
  21. float4 Po = float4(IN.Position.xyz,1);
  22. float3 Pw = mul(Po,WorldXf).xyz;
  23. OUT.LightVec = (Lamp0Pos - Pw);
  24. #ifdef FLIP_TEXTURE_Y
  25. OUT.UV = float2(IN.UV.x,(1.0-IN.UV.y));
  26. #else /* !FLIP_TEXTURE_Y */
  27. OUT.UV = IN.UV.xy;
  28. #endif /* !FLIP_TEXTURE_Y */
  29. OUT.WorldView = normalize(ViewIXf[3].xyz - Pw);
  30. OUT.HPosition = mul(Po,WvpXf);
  31. return OUT;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement