Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: C# | Size: 0.81 KB | Hits: 18 | Expires: Never
Copy text to clipboard
  1. float4x4 World;
  2. float4x4 View;
  3. float4x4 Projection;
  4.  
  5. sampler tex;
  6.  
  7. struct VertexShaderInput
  8. {
  9.     float4 Position : POSITION0;
  10. };
  11. struct VertexShaderOutput
  12. {
  13.     float4 Position : POSITION0;
  14. };
  15. VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
  16. {
  17.     VertexShaderOutput output;
  18.  
  19.     float4 worldPosition = mul(input.Position, World);
  20.     float4 viewPosition = mul(worldPosition, View);
  21.     output.Position = mul(viewPosition, Projection);
  22.  
  23.     return output;
  24. }
  25. float4 PixelShaderFunction(float2 uv : TEXCOORD0, float4 tint : COLOR0) : COLOR0
  26. {
  27.         float4 color = tex2D(tex, uv);
  28.        
  29.         return color * tint;
  30. }
  31. technique Technique1
  32. {
  33.     pass Pass1
  34.     {
  35.         VertexShader = compile vs_1_1 VertexShaderFunction();
  36.         PixelShader = compile ps_2_0 PixelShaderFunction();
  37.     }
  38. }