texture TheTexture : BackBuffer;

float4 BloomValues;

sampler sampledMap = 
sampler_state
{
    Texture = <TheTexture>;
    MipFilter = NONE;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    ADDRESSU = CLAMP;
    ADDRESSV = CLAMP;
};

struct PS_OUTPUT
{
    float4 Color : COLOR0;   
};

struct VS_OUTPUT
{
    float4 Pos  : POSITION;
    float2 Tex  : TEXCOORD0;
};

PS_OUTPUT PS( VS_OUTPUT In) 
{ 
    PS_OUTPUT Output;
    Output.Color=0;	

    float4 bloom = tex2D(sampledMap,In.Tex);	

  	bloom.xyz += BloomValues.x;
	bloom.xyz = pow(bloom, BloomValues.y)*BloomValues.z;
	bloom.w = 1;

	Output.Color = bloom;
    return Output;
}

///////////////////////////////////////
//Technique
///////////////////////////////////////


technique Effect
{
    pass P0
    {
		AlphaBlendEnable= FALSE;
    	ColorOp[0] = SelectArg1;
    	ColorArg1[0] = Texture;
    	ColorOp[1] = Disable;
		AddressU[0] = CLAMP;
		AddressV[0] = CLAMP;
		VertexShader = NULL;
		PixelShader  = compile ps_2_0 PS();	
		ZWriteEnable = false;
    }
}