sampler texture0 : register(s0);

float4x4 WorldViewProjectionTransform;
float4 backgroundColor;

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

struct PS_OUTPUT
{
    float4 RGBColor : COLOR0;
};

VS_OUTPUT vertexMain(
				float4 vPosition : POSITION,
				float2 texCoord : TEXCOORD0)
{
	VS_OUTPUT Output; 
 	Output.TexCoord  = texCoord;
	Output.Position = mul(vPosition, WorldViewProjectionTransform);
 	return( Output );
}

PS_OUTPUT pixelMain(VS_OUTPUT In)
{
	PS_OUTPUT Output;
	float fIntensity = tex2D(texture0, In.TexCoord).r;
	Output.RGBColor  = backgroundColor / 255.f * fIntensity;
	Output.RGBColor.a = 1.f;
	return Output; 
	
}