//-----------------------------------------------------------------------------
float SampleOffsetX = 0.0075; 
float SampleOffsetY = 0.0075;

texture TextureDifuse;            
texture TextureLightMap;                 
texture TextureNormalMap;
texture TextureCubeMap;                 
texture TextureShadowMap;

float    g_fTime;        
float4x4 g_mWorld;     
float4x4 g_mWorldViewProjection;   
float4x4 g_mShadowProjection;
vector   CameraPosition;
vector   g_LightAmbient =  {1.0f, 1.0f, 1.0f, 1.0f};
float4   UV;
vector   ExtraVector = { 0.5f, 0.5f, 0.5f, 0.5f }; 

texture SrcColor;

//-----------------------------------------------------------------------------
sampler2D Sampler0 =
sampler_state
{
 Texture = <SrcColor>;
 AddressU = Clamp;
 AddressV = Clamp;
 MinFilter = Point;
 MagFilter = Linear;
 MipFilter = Linear;
};
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
float4 HorizontalBlur( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-4)*SampleOffsetX);
  Color += tex2D( Sampler0, float2(Tex.x+offset, Tex.y));
 }
*/
 return Color*0.125;
}
//-----------------------------------------------------------------------------
float4 VerticalBlur( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-4)*SampleOffsetY);
  Color += tex2D(Sampler0, float2(Tex.x, Tex.y+offset) );
 }
*/
 return Color*0.125;
}
//-----------------------------------------------------------------------------
float4 HorizontalBlur1_4( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-2)*0.0075);
  Color += tex2D( Sampler0, float2(Tex.x+offset, Tex.y));
 }
   */
 return Color*0.125;
}
//-----------------------------------------------------------------------------
float4 VerticalBlur1_4( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-2)*0.0075);
  Color += tex2D(Sampler0, float2(Tex.x, Tex.y+offset) );
 }
*/
 return Color*0.125;
}
//-----------------------------------------------------------------------------
float4 Star001( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-4)*0.0075);
  Color += tex2D(Sampler0, float2(Tex.x+offset, Tex.y+offset) );
 }
*/
 return Color*0.13;
}
//-----------------------------------------------------------------------------
float4 Star002( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-4)*0.0075);
  Color += tex2D(Sampler0, float2(Tex.x+offset, Tex.y-offset) );
 }
*/
 return Color*0.13;
}
//-----------------------------------------------------------------------------
float4 Star003( float2 Tex : TEXCOORD0 ) : COLOR0
{
 float4 Color = 0;
/*
 for (int i = 0; i < 3; i++)
 {    
  float offset = ((i-4)*0.0075);
  Color += tex2D(Sampler0, float2(Tex.x, Tex.y+offset) );
 }
*/
 return Color*0.13;
}


technique PostProcess
{
 pass p0
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 HorizontalBlur();
  ZEnable = false;
 }
 pass p1
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 VerticalBlur();
  ZEnable = false;
 }
 pass p2
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 Star001();
  ZEnable = false;
 }
 pass p3
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 Star002();
  ZEnable = false;
 }
 pass p4
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 Star003();
  ZEnable = false;
 }
 pass p5
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 HorizontalBlur1_4();
  ZEnable = false;
 }
 pass p6
 {
  VertexShader = null;
  PixelShader = compile ps_1_4 VerticalBlur1_4();
  ZEnable = false;
 }


}
//-----------------------------------------------------------------------------
