sampler texture0 : register(s0);

float4x4 WorldViewProjectionTransform  : WORLDVIEWPROJ;
float fMaxAlpha;

struct VS_OUTPUT 
{
   float4 Position  : POSITION;
   float2 TexCoord  : TEXCOORD0;    
};

struct PS_OUTPUT
{
    float4 RGBColor : COLOR0;  // Pixel color    
};

VS_OUTPUT vertexMain(
				float4 vPosition : POSITION,
				float2 texCoord0 : TEXCOORD0)
{
	VS_OUTPUT Output; 

	Output.Position = mul(vPosition, WorldViewProjectionTransform);
	Output.TexCoord = texCoord0;   

	return Output;
}

PS_OUTPUT pixelMain(VS_OUTPUT In)
{
   PS_OUTPUT result;

   float brighten = (1.f - In.TexCoord.y) * 200;
   modf(brighten, brighten);
   brighten %= 2;
   brighten *= 0.25f;
   brighten += 1.f;

   result.RGBColor = saturate(tex2D(texture0, In.TexCoord) * brighten);
   result.RGBColor.a = min(fMaxAlpha, result.RGBColor.a);
   
   return result;
}