Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 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. float4 pColor;
  11. float pAmount;
  12.  
  13. matrix WorldViewProjection;
  14. sampler s0;
  15.  
  16. struct VertexShaderInput
  17. {
  18. float4 Position : POSITION0;
  19. float4 Color : COLOR0;
  20. };
  21.  
  22. struct VertexShaderOutput
  23. {
  24. float4 Position : SV_POSITION;
  25. float4 Color : COLOR0;
  26. float2 TextureCoordinates : TEXCOORD0;
  27. };
  28.  
  29. VertexShaderOutput MainVS(in VertexShaderInput input)
  30. {
  31. VertexShaderOutput output = (VertexShaderOutput) 0;
  32.  
  33. output.Position = mul(input.Position, WorldViewProjection);
  34. output.Color = input.Color;
  35.  
  36. return output;
  37. }
  38.  
  39. float4 MainPS(VertexShaderOutput input) : COLOR
  40. {
  41. float4 finalColor = tex2D(s0, input.TextureCoordinates);
  42. return lerp(finalColor, pColor * finalColor.a, pAmount);
  43. }
  44.  
  45. technique BasicColorDrawing
  46. {
  47. pass P0
  48. {
  49. PixelShader = compile PS_SHADERMODELMainPS();
  50. }
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement