Guest User

Untitled

a guest
Jan 25th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #if OPENGL
  2.     #define SV_POSITION POSITION
  3.     #define VS_SHADERMODEL vs_3_0
  4.     #define PS_SHADERMODEL ps_3_0
  5. #else
  6.     #define VS_SHADERMODEL vs_4_0_level_9_1
  7.     #define PS_SHADERMODEL ps_4_0_level_9_1
  8. #endif
  9.  
  10. matrix WorldViewProjection;
  11.  
  12. struct VertexShaderInput
  13. {
  14.     float4 Position : POSITION0;
  15.     float4 Color : COLOR0;
  16. };
  17.  
  18. struct VertexShaderOutput
  19. {
  20.     float4 Position : SV_POSITION;
  21.     float4 Color : COLOR0;
  22. };
  23.  
  24. VertexShaderOutput MainVS(in VertexShaderInput input)
  25. {
  26.     VertexShaderOutput output = (VertexShaderOutput)0;
  27.  
  28.     output.Position = mul(input.Position, WorldViewProjection);
  29.     output.Color = input.Color;
  30.  
  31.     return output;
  32. }
  33.  
  34. float4 MainPS(VertexShaderOutput input) : COLOR
  35. {
  36.     return input.Color;
  37. }
  38.  
  39. technique BasicColorDrawing
  40. {
  41.     pass P0
  42.     {
  43.         VertexShader = compile VS_SHADERMODEL MainVS();
  44.         PixelShader = compile PS_SHADERMODEL MainPS();
  45.     }
  46. };
Add Comment
Please, Sign In to add comment