Advertisement
Guest User

Untitled

a guest
Nov 27th, 2021
18
194 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. float4x4 WorldViewProjection;
  11. //texture Texture;
  12.  
  13.  
  14.  
  15. struct VertexShaderInput
  16. {
  17. float4 Position : SV_POSITION;
  18. float3 Normal : NORMAL;
  19. float2 TexCoord : TEXCOORD0;
  20.  
  21. };
  22.  
  23. struct VertexShaderOutput
  24. {
  25. float4 Position : SV_POSITION;
  26.  
  27. //float4 TexCoords : TEXCOORD0;
  28. };
  29.  
  30. VertexShaderOutput MainVS(VertexShaderInput input)
  31. {
  32. VertexShaderOutput output = (VertexShaderOutput)0;
  33.  
  34. output.Position = mul(input.Position, WorldViewProjection);
  35.  
  36. return output;
  37. }
  38.  
  39. //sampler2D texSampler;
  40.  
  41. float4 MainPS(VertexShaderOutput input) : COLOR
  42. {
  43. float4 red = {1, 0, 0, 1};
  44. return red;
  45. //float4 red = {1, 0, 0, 1};
  46. //return red;
  47. }
  48.  
  49. technique BasicColorDrawing
  50. {
  51. pass P0
  52. {
  53. VertexShader = compile VS_SHADERMODEL MainVS();
  54. PixelShader = compile PS_SHADERMODEL MainPS();
  55. }
  56. };
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement