Guest User

Untitled

a guest
Nov 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. texture ScreenTexture;
  2.  
  3. sampler TextureSampler = sampler_state
  4. {
  5.     Texture = <ScreenTexture>;
  6. };
  7.  
  8. float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0
  9. {
  10.     float4 color = tex2D(TextureSampler, TextureCoordinate);
  11.  
  12.     color = mul ( color, 255 );
  13.  
  14.     if ( color.r > 127 )
  15.         {
  16.         color.r = 255;
  17.         }
  18.     else
  19.         {
  20.         color.r = 0;
  21.         }
  22.  
  23.     if ( color.g > 127 )
  24.         {
  25.         color.g = 255;
  26.         }
  27.     else
  28.         {
  29.         color.g = 0;
  30.         }
  31.  
  32.  
  33.     if ( color.b > 127 )
  34.         {
  35.         color.b = 255;
  36.         }
  37.     else
  38.         {
  39.         color.b = 0;
  40.         }
  41.  
  42.     color = mul ( color, 1/255 );
  43.  
  44.     return color;
  45. }
  46.  
  47. technique ShopColors
  48. {
  49.     pass Pass1
  50.     {
  51.         PixelShader = compile ps_2_0 PixelShaderFunction();
  52.     }
  53. }
Add Comment
Please, Sign In to add comment