Advertisement
alaskajohn

Default Pixel Shader 3.0 for XNA

Nov 5th, 2013
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. float4x4 MatrixTransform;
  2.  
  3. void SpriteVertexShader(inout float4 vColor : COLOR0, inout float2 texCoord : TEXCOORD0, inout float4 position : POSITION0)
  4. {
  5.     position = mul(position, MatrixTransform);
  6. }
  7.  
  8. uniform extern texture ScreenTexture;  
  9. sampler ScreenS = sampler_state
  10. {
  11.     Texture = <ScreenTexture>; 
  12. };
  13.  
  14.  
  15. float4 PixelShaderFunction(float2 texCoord: TEXCOORD0) : COLOR0
  16. {
  17.     float4 color = tex2D(ScreenS, texCoord);
  18.     //Add shader here
  19.     return color;
  20.    
  21. }
  22.  
  23. technique Technique1
  24. {
  25.     pass Pass1
  26.     {
  27.         VertexShader = compile vs_3_0 SpriteVertexShader();
  28.         PixelShader = compile ps_3_0 PixelShaderFunction();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement