Advertisement
Guest User

Shader

a guest
Jan 14th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. //--------------------------------------------------------------------------------------
  2. // basicEffect.fx
  3. //--------------------------------------------------------------------------------------
  4. matrix World;
  5. matrix View;
  6. matrix Projection;
  7.  
  8. struct PS_INPUT
  9. {
  10. float4 Pos : SV_POSITION;
  11. float4 Color : COLOR;
  12. };
  13.  
  14. struct VS_INPUT
  15. {
  16. float4 Pos : POSITION;
  17. float4 Color : COLOR;
  18. };
  19.  
  20. //--------------------------------------------------------------------------------------
  21. // Vertex Shader
  22. //--------------------------------------------------------------------------------------
  23. PS_INPUT VS( VS_INPUT input )
  24. {
  25. PS_INPUT output;
  26.  
  27. output.Pos = mul( input.Pos, World );
  28. output.Pos = mul( output.Pos, View );
  29. output.Pos = mul( output.Pos, Projection );
  30. output.Color = input.Color;
  31.  
  32. return output;
  33. }
  34.  
  35. //--------------------------------------------------------------------------------------
  36. // Pixel Shader
  37. //--------------------------------------------------------------------------------------
  38. float4 PS( PS_INPUT input ) : SV_Target
  39. {
  40. return input.Color;
  41. }
  42.  
  43.  
  44. //--------------------------------------------------------------------------------------
  45. // Techniques
  46. //--------------------------------------------------------------------------------------
  47. technique10 render
  48. {
  49. pass P0
  50. {
  51. SetVertexShader( CompileShader( vs_4_0, VS() ) );
  52. SetGeometryShader( NULL );
  53. SetPixelShader( CompileShader( ps_4_0, PS() ) );
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement