home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Aplikacje_64-bitowe / Daum_PotPlayer / PotPlayer1.5.29332-x64.EXE / PxShader / Sharpen.txt < prev    next >
Encoding:
Text File  |  2010-05-20  |  936 b   |  33 lines

  1. // Sharpen_3x3=ps_2_0
  2. // Code from MPC
  3.  
  4. sampler s0 : register(s0); 
  5. float4 p0 : register(c0); 
  6. float4 p1 : register(c1); 
  7.  
  8. #define width (p0[0]) 
  9. #define height (p0[1]) 
  10.  
  11. #define effect_width (1.6) 
  12. #define val0 (2.0) 
  13. #define val1 (-0.125) 
  14.  
  15. float4 main(float2 tex : TEXCOORD0) : COLOR 
  16.     float dx = effect_width/width; 
  17.     float dy = effect_width/height; 
  18.  
  19.     float4 c1 = tex2D(s0, tex + float2(-dx,-dy)) * val1; 
  20.     float4 c2 = tex2D(s0, tex + float2(0,-dy)) * val1; 
  21.     float4 c3 = tex2D(s0, tex + float2(-dx,0)) * val1; 
  22.     float4 c4 = tex2D(s0, tex + float2(dx,0)) * val1; 
  23.     float4 c5 = tex2D(s0, tex + float2(0,dy)) * val1; 
  24.     float4 c6 = tex2D(s0, tex + float2(dx,dy)) * val1; 
  25.     float4 c7 = tex2D(s0, tex + float2(-dx,+dy)) * val1; 
  26.     float4 c8 = tex2D(s0, tex + float2(+dx,-dy)) * val1; 
  27.     float4 c9 = tex2D(s0, tex) * val0; 
  28.     
  29.     float4 c0 = (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9); 
  30.     
  31.     return c0; 
  32. }