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

//---------------------------------------------------------------------
// Filter data

float g_fTime = 1.0f;										// The time variable

float4 g_vfYBias = float4( 0.01f, -0.01f, 0.0f, 0.015f );	


//-----------------------------------------------------------------------------
// Pixel Shader: ColorStutter
// Desc: Performs post-processing effect that stutter the source image
//-----------------------------------------------------------------------------
float4 ColorStutter(float2 Tex : TEXCOORD0) : COLOR0
{
	// Retrieve the fractionnal part of the time value
	int fFracTime = (int)(frac(g_fTime) * 4);
	Tex.y += g_vfYBias[fFracTime];
	
	// And return the color	
	return tex2D(g_samSrcColor, Tex);
}


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