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

  1. // contour=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 = 4/width;
  13.     float dy = 4/height;
  14.     
  15.     float4 c2 = tex2D(s0, tex + float2(0,-dy));
  16.     float4 c4 = tex2D(s0, tex + float2(-dx,0));
  17.     float4 c5 = tex2D(s0, tex + float2(0,0));
  18.     float4 c6 = tex2D(s0, tex + float2(dx,0));
  19.     float4 c8 = tex2D(s0, tex + float2(0,dy));
  20.     
  21.     float4 c0 = (-c2-c4+c5*4-c6-c8);
  22.     if(length(c0) < 1.0) c0 = float4(0,0,0,0);
  23.     else c0 = float4(1,1,1,0);
  24.     
  25.     return c0;
  26. }
  27.