//@author: vux
//@help: template for texture fx
//@tags: texture
//@credits: 

Texture2D texture2d : PREVIOUS;
Float Height <string uiname="Height"; float uimin=2.0;> = 10.0;

SamplerState linearSampler : IMMUTABLE
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Clamp;
    AddressV = Clamp;
};

struct psInput
{
	float4 p : SV_Position;
	float2 uv : TEXCOORD0;
};


float4 PS(psInput input) : SV_Target
{
	float4 c = texture2d.Sample(linearSampler,input.uv);
	
	float2 h = float2(0, 1 / Height);
	float4 c1 = texture2d.Sample(linearSampler,input.uv - h);
	float4 c2 = texture2d.Sample(linearSampler,input.uv + h);
	c = (c * 2 + c1 + c2) / 4;
	return c;
}

technique10 Process
{
	pass P0
	{
		SetPixelShader(CompileShader(ps_4_0,PS()));
	}
}



