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 / Letterbox.txt < prev    next >
Encoding:
Text File  |  2010-05-20  |  369 b   |  21 lines

  1. // letterbox=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.     float4 c0 = 0;
  13.     
  14.     float2 ar = float2(16, 9);
  15.     float h = (1 - width/height * ar.y/ar.x) / 2;
  16.     
  17.     if(tex.y >= h && tex.y <= 1-h)
  18.         c0 = tex2D(s0, tex);
  19.     
  20.     return c0;
  21. }