home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / eroticos / dreamstrippergdidemoinstall.exe / DreamStripper.msi / _8A941BDB14F779B8105FDFAA799C6946 / _A24D5382C5674D2A9A9A8898E80E8545 < prev    next >
Text File  |  2005-05-15  |  2KB  |  100 lines

  1. /*********************************************************************
  2. //*
  3. //*Copyright (c) 2001-2005, Ensign Games Ltd.  All rights reserved.
  4. //*    
  5. //*********************************************************************/ 
  6. float2 Resolution        : RESOLUTION    : register(c0);
  7.  
  8. sampler Source : register(s0);
  9.  
  10. struct VS_OUTPUT
  11. {
  12.     float4 Position                : POSITION;
  13.     float2 TexCoord0            : TEXCOORD0;
  14.     float2 TexCoord1            : TEXCOORD1;
  15.     float2 TexCoord2            : TEXCOORD2;
  16.     float2 TexCoord3            : TEXCOORD3;
  17.     float2 TexCoord4            : TEXCOORD4;
  18.     float2 TexCoord5            : TEXCOORD5;
  19.     float2 TexCoord6            : TEXCOORD6;
  20. };
  21.  
  22. VS_OUTPUT VS(in float4 Position : POSITION, in float2 TexCoord : TEXCOORD0)
  23. {
  24.     VS_OUTPUT Out = (VS_OUTPUT)0;
  25.     
  26.     Out.Position = Position;
  27.     Out.TexCoord0 = TexCoord;//center
  28.     
  29.     Out.TexCoord1 = TexCoord + Resolution * float2(0, -1);
  30.     Out.TexCoord2 = TexCoord + Resolution * float2(0, 1);
  31.     Out.TexCoord3 = TexCoord + Resolution * float2(1, 0);
  32.     Out.TexCoord4 = TexCoord + Resolution * float2(-1, 0);
  33.     
  34.     return Out;
  35. }
  36.  
  37. float4 PS(VS_OUTPUT In) : COLOR
  38. {
  39. //simple filter that weights the pixel based on the amount of alpha it has
  40.     float4 sample;
  41.     float3 color;
  42.     float divider;
  43.     float alpha;
  44.     
  45.     sample = tex2D(Source, In.TexCoord0);
  46.     divider = sample.a;
  47.     alpha = sample.a;
  48.  
  49.     color = sample.xyz * sample.a;
  50.  
  51.     sample = tex2D(Source, In.TexCoord1.xy); 
  52.     color += sample.xyz * sample.a; 
  53.     divider += sample.a;
  54.     
  55.     sample = tex2D(Source, In.TexCoord2.xy); 
  56.     color += sample.xyz * sample.a; 
  57.     divider += sample.a;
  58.     
  59.     sample = tex2D(Source, In.TexCoord3.xy); 
  60.     color += sample.xyz * sample.a; 
  61.     divider += sample.a;
  62.     
  63.     sample = tex2D(Source, In.TexCoord4.xy); 
  64.     color += sample.xyz * sample.a; 
  65.     divider += sample.a;
  66.  
  67.     return float4(color/divider, alpha);
  68. }
  69.  
  70. ///////////////////////////////////////////////////////////////////
  71. //Techniques
  72. ///////////////////////////////////////////////////////////////////
  73. technique Normal
  74. {
  75.  
  76.     pass TextureSpaceLighting
  77.     {
  78.         VertexShader = compile vs_2_0 VS();
  79.         PixelShader = compile ps_2_0 PS();
  80.         
  81.         MagFilter[0] = Linear;
  82.         MinFilter[0] = Linear;
  83.         MipFilter[0] = Linear;
  84.  
  85.         AddressU[0] = mirror;
  86.         AddressV[0] = mirror;
  87.     
  88.         ZEnable = false;
  89.         ZFunc = LessEqual;
  90.         FillMode = Solid;
  91.         ZWriteEnable = false;
  92.         AlphaTestEnable = false;
  93.         AlphaFunc = Always;
  94.         AlphaBlendEnable = false;
  95.         SrcBlend = One;
  96.         DestBlend = Zero;
  97.         BlendOp = Add;
  98.         CullMode = None;
  99.     }
  100. }