// Includes all post-process common data (textures & sampler)
#include "PPCommonData.fxh"


float3 LuminanceConv = { 0.3,0.59,0.11 };	// Ratio to convert to luminance value
float3 SepiaConv= { 0.9f, 0.7f, 0.3f };		// My prefered sepia tone


//-----------------------------------------------------------------------------
// Pixel Shader: ColorSepia
// Desc: Performs post-processing effect that converts a colored image to
//       sepia tone;
//-----------------------------------------------------------------------------
float4 ColorSepia(float2 Tex : TEXCOORD0) : COLOR0
{
	// compute the luminance
	float fLuminance = dot((float3)tex2D(g_samSrcColor, Tex), LuminanceConv);
	
	// Retrieve the source color
	return float4(fLuminance * SepiaConv, 1.0f);
}


//-----------------------------------------------------------------------------
// Technique: PostProcess
// Desc: Performs post-processing effect that converts a colored image to
//       sepia tones.
//-----------------------------------------------------------------------------
technique PostProcess
{
    pass p0
    {
	ZEnable = false;
		
        VertexShader = null;
        PixelShader = compile ps_2_0 ColorSepia();
    }
}
