//-----------------------------------------------------------------------------
// File: op_hlsl_highpass.fx
//
// Desc: Effect file for image post-processing sample.  This effect contains
//       a single technique with a pixel shader that subtract a constant from every color.
//-----------------------------------------------------------------------------


float4x4 TotalMatrix;
float4 VectorFromObject; // z=value added (can be negative)
float4 TextureFactor; // object rgba
float4 VectorFromShader;

texture g_Texture0;

sampler2D g_samSrcColor : register(s0) =
sampler_state
{
    Texture = <g_Texture0>;
    AddressU = Clamp;
    AddressV = Clamp;
    MinFilter = Point;
    MagFilter = Linear;
    MipFilter = Linear;
};


//-----------------------------------------------------------------------------
// Pixel Shader: PostProcessPS
// Desc: Performs post-processing effect that inverts the image
//-----------------------------------------------------------------------------

float4 PostProcessPS(float2 tex : TEXCOORD0) : COLOR0
{
	float4 color = tex2D(g_samSrcColor, tex);
	
	color.r += VectorFromObject.z;
	color.g += VectorFromObject.z;
	color.b += VectorFromObject.z;
	color.a = 1.0;

	color *= TextureFactor;

	return float4(color.r, color.g, color.b, color.a); // RGBA
}




//-----------------------------------------------------------------------------
// Technique: PostProcess
// Desc: Performs post-processing effect that inverts the image
//-----------------------------------------------------------------------------
technique PostProcess
{
    pass p0
    {
        VertexShader = null;
        PixelShader = compile ps_2_0 PostProcessPS();
        ZEnable = false;
    }
}
