simple.fx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //-----------------------------------------------------------------------------
  2. // Simple.fx
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. //Input variables
  8. float4x4 worldViewProjection;
  9. struct VS_INPUT
  10. {
  11. float4 ObjectPos: POSITION;
  12. float4 VertexColor: COLOR;
  13. };
  14. struct VS_OUTPUT
  15. {
  16. float4 ScreenPos: POSITION;
  17. float4 VertexColor: COLOR;
  18. };
  19. VS_OUTPUT SimpleVS(VS_INPUT In)
  20. {
  21. VS_OUTPUT Out;
  22. //Move to screen space
  23. Out.ScreenPos = mul(In.ObjectPos, worldViewProjection);
  24. Out.VertexColor = In.VertexColor;
  25. return Out;
  26. }
  27. float4 SimplePS(float4 color : COLOR0) : COLOR0
  28. {
  29. return color;
  30. }
  31. //--------------------------------------------------------------//
  32. // Technique Section for Simple screen transform
  33. //--------------------------------------------------------------//
  34. technique Simple
  35. {
  36. pass Single_Pass
  37. {
  38. VertexShader = compile vs_1_1 SimpleVS();
  39. PixelShader = compile ps_2_0 SimplePS();
  40. }
  41. }