/// Sharpen Shader Test 2 DKT70

float	PassNumber;

float4x4 worldviewproj;

//--------------------------------------------------------------------------------------
// Textures
//--------------------------------------------------------------------------------------
texture2D texColor;

//--------------------------------------------------------------------------------------
// Sampler Inputs
//--------------------------------------------------------------------------------------

sampler2D InputSampler = sampler_state
{
    	Texture = (texColor);
    	MinFilter = Point;
    	MagFilter = Point;
    	MipFilter = Point;
    	AddressU  = Clamp;
	AddressV  = Clamp;
	SRGBTexture=FALSE;
	MaxMipLevel=0;
	MipMapLodBias=0;
};


struct VS_OUTPUT_POST {
 float4 vpos  : POSITION;
 float2 txcoord : TEXCOORD0;
};

struct VS_INPUT_POST {
 float3 pos  : POSITION;
 float2 txcoord : TEXCOORD0;
};

float pixelWidth;
float pixelHeight;

//--------------------------------------------------------------------------------------
// Vertex Shader Input
//--------------------------------------------------------------------------------------

VS_OUTPUT_POST VS_PostProcess(VS_INPUT_POST IN)
{
 VS_OUTPUT_POST OUT;

 float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);

 OUT.vpos=pos;
 OUT.txcoord.xy=IN.txcoord.xy;

 return OUT;
}

//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------

float4 main(float2 uv : TEXCOORD) : COLOR
{
    float2 InputSize =float2(1920, 1080/1.78);
    float Amount = 0.7; // Strength
    float2 offset = 0.1 / InputSize;
    float4 color;
    color = tex2D(InputSampler, uv);
    color += tex2D(InputSampler, uv - offset) * Amount;
    color -= tex2D(InputSampler, uv + offset) * Amount;
    return color;
}

//--------------------------------------------------------------------------------------
// Compiler
//--------------------------------------------------------------------------------------
technique PostProcess
{
    pass P0
    {
#ifdef E_SHADER_3_0
 VertexShader = compile vs_3_0 VS_PostProcess();
 PixelShader  = compile ps_3_0 main();
#else
 VertexShader = compile vs_2_0 VS_PostProcess();
 PixelShader  = compile ps_2_0 main();
#endif

 ZEnable=FALSE;
 CullMode=NONE;
 ALPHATESTENABLE=FALSE;
 SEPARATEALPHABLENDENABLE=FALSE;
 AlphaBlendEnable=FALSE;
 FogEnable=FALSE;
 SRGBWRITEENABLE=FALSE;
 }
}
