home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / SPlayer / SPlayerSetup.exe / splayer.exe / 2052 / FILE / 719 < prev    next >
Encoding:
Text File  |  2009-12-01  |  985 b   |  39 lines

  1. sampler s0 : register(s0);
  2. float4 p0 : register(c0);
  3.  
  4. #define width (p0[0])
  5. #define height (p0[1])
  6.  
  7. #define val0 (0.93)
  8. #define val1 (0.125) 
  9.  
  10. #define effect_width (0.1)
  11.  
  12. float4 main(float2 tex : TEXCOORD0) : COLOR
  13. {    
  14.     float dx = 0.0f;
  15.     float dy = 0.0f;
  16.      float fTap = effect_width;
  17.  
  18.     float4 cAccumX = tex2D(s0, tex) * val0  ;
  19.  
  20.     for ( int iDx = 0 ; iDx < 16; ++iDx )
  21.     {
  22.         dx = fTap /width; 
  23.             dy = fTap /height; 
  24.         float cAccum = 0.0f;
  25.         cAccum += tex2D(s0, tex + float2(-dx,-dy)) * val1;
  26.         cAccum += tex2D(s0, tex + float2(0,-dy)) * val1;
  27.         cAccum += tex2D(s0, tex + float2(-dx,0)) * val1;
  28.         cAccum += tex2D(s0, tex + float2(dx,0)) * val1;
  29.         cAccum += tex2D(s0, tex + float2(0,dy)) * val1;
  30.         cAccum += tex2D(s0, tex + float2(dx,dy)) * val1;
  31.         cAccum += tex2D(s0, tex + float2(-dx,+dy)) * val1;
  32.         cAccum += tex2D(s0, tex + float2(+dx,-dy)) * val1;
  33.                 cAccumX += cAccum / 16.0f;
  34.         fTap  += 0.1f;
  35.         break;
  36.     }
  37.     
  38.     return cAccumX;
  39. }