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 / Emboss.txt < prev    next >
Text File  |  2010-05-20  |  607b  |  27 lines

  1. // emboss=ps_2_0
  2. // Code from MPC
  3.  
  4. sampler s0 : register(s0);
  5. float4 p0 : register(c0);
  6.  
  7. #define width (p0[0])
  8. #define height (p0[1])
  9.  
  10. float4 main(float2 tex : TEXCOORD0) : COLOR
  11. {
  12.     float dx = 1/width;
  13.     float dy = 1/height;
  14.     
  15.     float4 c1 = tex2D(s0, tex + float2(-dx,-dy));
  16.     float4 c2 = tex2D(s0, tex + float2(0,-dy));
  17.     float4 c4 = tex2D(s0, tex + float2(-dx,0));
  18.     float4 c6 = tex2D(s0, tex + float2(dx,0));
  19.     float4 c8 = tex2D(s0, tex + float2(0,dy));
  20.     float4 c9 = tex2D(s0, tex + float2(dx,dy));
  21.     
  22.     float4 c0 = (-c1-c2-c4+c6+c8+c9);
  23.     c0 = (c0.r+c0.g+c0.b)/3 + 0.5;
  24.     
  25.     return c0;
  26. }
  27.