Advertisement
Guest User

Untitled

a guest
Jan 30th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. float4x4 viewProjection;
  6.  
  7. struct VS_INPUT
  8. {
  9. float4 vPosition: POSITION;
  10. float3 vNormal : NORMAL;
  11. float4 color : COLOR;
  12. float2 texCoord : TEXCOORD0;
  13. float4 W0 : TEXCOORD1;
  14. float4 W1 : TEXCOORD2;
  15. float4 W2 : TEXCOORD3;
  16. float4 W3 : TEXCOORD4;
  17. //float4 Stemp : TEXCOORD5;
  18. };
  19.  
  20.  
  21. struct VS_OUTPUT
  22. {
  23. float4 Position :POSITION; // vertex position
  24. float2 tcoord : TEXCOORD1;
  25. };
  26.  
  27. VS_OUTPUT vsmain(VS_INPUT Inputs)
  28. {
  29. VS_OUTPUT tout;
  30. float4x4 transformation = float4x4(Inputs.W0, Inputs.W1, Inputs.W2, Inputs.W3);
  31. float4 pos = mul(Inputs.vPosition, transformation);
  32. tout.Position = mul(pos, viewProjection);
  33. tout.tcoord = Inputs.texCoord;
  34.  
  35. return tout;
  36. }
  37.  
  38. Texture2D tex1 : register(t0);
  39. //TODO find out why only s1 works and not s0?
  40. SamplerState sampler1 : register(s1);
  41.  
  42. float4 psmain(VS_OUTPUT input) : SV_Target
  43. {
  44. return tex1.Sample(sampler1, input.tcoord);
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement