Advertisement
weeez

Shader

Mar 2nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. float4x4 xWorldViewProjection;
  2.  
  3. struct VS_IN
  4. {
  5.     float4 Position : POSITION0;
  6.     float4 Color    : COLOR0;
  7. };
  8.  
  9. struct PS_IN
  10. {
  11.     float4 Position : SV_POSITION;
  12.     float4 Color    : COLOR0;
  13. };
  14.  
  15. // -------------
  16. // Vertex Shader
  17. // -------------
  18. PS_IN vs_main(VS_IN input)
  19. {
  20.     PS_IN output;
  21.  
  22.     output.Position = mul(input.Position, xWorldViewProjection);
  23.     output.Color = input.Color;
  24.  
  25.     return output;
  26. }
  27.  
  28. // ------------
  29. // Pixel Shader
  30. // ------------
  31. float4 ps_main(PS_IN input) : SV_TARGET
  32. {
  33.     return input.Color;
  34. }
  35.  
  36. // ----------
  37. // Techniques
  38. // ----------
  39. technique11 BasicRender
  40. {
  41.     pass BasicTriangle
  42.     {
  43.         SetVertexShader(CompileShader(vs_4_0_level_9_1, vs_main()));
  44.         SetPixelShader(CompileShader(ps_4_0_level_9_1, ps_main()));
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement